:root{
  --bg:#0b0f14; --card:#111723; --muted:#0e141e; --primary:#47c3ff; --accent:#9cff57;
  --text:#e8ecf2; --sub:#a8b0bd; --border:#2a3446; --warn:#ffcc66; --danger:#ff6b6b;
  --radius:16px; --shadow:0 10px 30px rgba(0,0,0,.25);

  /* Logo word colors */
  --brand1:#47c3ff; /* Blockchain */
  --brand2:#9cff57; /* Casino */
  --brand3:#ff8ad6; /* Hub */
}

/* ===== Reset & base ===== */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial,
               "Noto Sans","Noto Sans KR","Noto Sans JP","Noto Sans SC",
               "Noto Sans Arabic","Noto Sans Devanagari",sans-serif;
  background:var(--bg); color:var(--text);
  font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.05rem);
}
a{color:inherit; text-decoration:none}
img{max-width:100%; display:block}
.container{width:min(1200px,100% - 32px); margin-inline:auto}

/* ===== Header / Nav ===== */
header{
  position:sticky; top:0; z-index:50;
  backdrop-filter:saturate(1.2) blur(8px);
  background:linear-gradient(180deg, rgba(11,15,20,.9), rgba(11,15,20,.6));
  border-bottom:1px solid var(--border);
}
.nav{
  display:flex; align-items:center; justify-content:flex-start;
  gap:20px; padding:16px 0;
  flex-wrap:nowrap; /* 기본은 한 줄 유지 */
}
.logo{
  display:flex; align-items:center; gap:12px; font-weight:800;
  flex-wrap:nowrap; white-space:nowrap; flex-shrink:0;
}
.logo-badge{
  width:clamp(44px, 40px + 2vw, 56px);
  height:clamp(44px, 40px + 2vw, 56px);
  border-radius:14px;
  background:linear-gradient(135deg,var(--primary),var(--accent));
  box-shadow:var(--shadow);
}

/* Logo text */
.logo-text{
  font-weight:800;
  letter-spacing:0;
  display:inline-block;
  white-space:nowrap;
  font-size:clamp(1.6rem, 1.2rem + 1vw, 2rem);
}
.logo-text span{ display:inline; margin:0; padding:0; }
.brand-blockchain{ color:var(--brand1); }
.brand-casino{     color:var(--brand2); }
.brand-hub{        color:var(--brand3); }
.brand-dotcom{     color:#fff; }

/* Right area (menu + language) */
.nav-right{
  margin-left:auto;
  display:flex; align-items:center; gap:16px; /* 28 → 16 */
}
.nav-links{display:flex; gap:24px; color:var(--sub);}
.nav-links a{
  font-weight:700; line-height:1;
  font-size:clamp(0.9rem, 0.75rem + 0.35vw, 1.05rem);
  display:flex; align-items:center; padding:8px 0; /* 높이 정렬 */
}
.nav-links a:hover{color:var(--text)}

/* CTA + Language */
.cta{display:flex; align-items:center; gap:12px;}
.btn{
  padding:8px 12px;
  border-radius:12px; border:1px solid var(--border);
  background:var(--muted); color:var(--text); cursor:pointer;
  font-weight:700;
  font-size:clamp(0.98rem, 0.8rem + 0.4vw, 1.1rem);
  min-height:44px; /* 접근성 터치 높이 */
}
.btn.primary{background:var(--primary); border-color:transparent; color:#001018}
.btn:hover{filter:brightness(1.08)}
.lang{display:flex; align-items:center; gap:10px}
.lang label,
.select{
  font-weight:700;
  font-size:clamp(0.98rem, 0.8rem + 0.4vw, 1.1rem);
}
.select{
  appearance:none; -webkit-appearance:none; -moz-appearance:none;
  background:var(--muted); border:1px solid var(--border);
  color:var(--text); padding:8px 12px; border-radius:12px;
}

/* 1180px: 헤더 2줄 허용 (로고 1줄, 메뉴 2줄) */
@media (max-width: 1180px){
  .nav{ flex-wrap: wrap; row-gap: 10px; }
  .logo{ order: 1; flex: 0 1 auto; }
  .nav-right{
    order: 2; margin-left: 0; width: 100%;
    display: flex; align-items: center; justify-content:space-between; gap: 12px;
  }
  .nav-links{
    flex: 1 1 auto;
    display:flex; flex-wrap:wrap; gap:12px;
  }
  .cta{ flex:0 0 auto; }
}

/* 880px: 소폭 축소 */
@media (max-width: 880px){
  .nav-links a{ font-size: 1.05rem; }
  .btn{ font-size: 1rem; padding: 8px 12px; }
  .lang label, .select{ font-size: 1rem; }
}

/* Hamburger (통합본) */
.hamburger {
  display: none;
  width: 28px; height: 24px;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
}
.hamburger span {
  display: block;
  height: 3px;
  background: var(--text);
  border-radius: 2px;
}
.hamburger:focus { outline: none; }

/* 720px: 모바일 메뉴 토글 */
@media (max-width: 720px) {
  .container { padding-inline: 12px; }
  .hamburger { display: flex; }

  .nav-right { display: none; }
  .nav-right.active {
    display:flex; flex-direction:column; gap:16px; width:100%;
    background:var(--card); border-radius:var(--radius);
    padding:12px; margin-top:10px;
  }

  .nav-links {
    display:none; flex-direction:column; gap:8px; width:100%;
    background:var(--card); border-radius:var(--radius); padding:12px;
  }
  .nav-links.active { display:flex; }
  .nav-links a {
    padding:8px 0;
    border-bottom:1px solid var(--border);
  }

  .hide-mobile{ display:none !important; }
  .nav-right.active .hide-mobile{ display:inline !important; }
}

/* ===== Hero & common sections ===== */
.hero{padding:36px 0 20px}
.hero-grid{display:grid; grid-template-columns:1.6fr .9fr; gap:18px}
@media (max-width:960px){ .hero-grid{grid-template-columns:1fr} }

.panel{background:var(--card); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow)}
.hero-main{padding:24px}
.kicker{color:var(--accent); font-weight:700; letter-spacing:.02em}
.title{font-size:clamp(24px,3vw,36px); line-height:1.2; margin:8px 0 10px}
.sub{color:var(--sub)}
.search{margin-top:16px; display:flex; gap:8px}
.input{flex:1; background:#0e141e; border:1px solid var(--border); border-radius:12px; padding:12px 14px; color:var(--text)}
.pillbar{display:flex; gap:8px; margin-top:12px; flex-wrap:wrap}
.pill{font-size:14px; color:var(--sub); padding:8px 10px; border:1px solid var(--border); border-radius:999px; background:#0e141e; cursor:pointer}
.score{display:flex; align-items:center; gap:12px; margin-top:18px}
.stars{display:inline-flex; gap:4px}
.star{width:18px; height:18px; fill:gold}

.hero-side{display:grid; gap:12px; padding:12px}
.side-item{display:flex; gap:12px; padding:12px; border-radius:14px; border:1px solid var(--border); background:var(--muted)}
.side-item .tag{font-size:12px; color:#001018; background:var(--accent); padding:4px 8px; border-radius:999px; font-weight:700}

section{padding:20px 0}
.section-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:12px}
.section-head h2{font-size:20px; margin:0}

/* ===== Grid ===== */
.grid{display:grid; gap:12px}
.grid.cols-3{grid-template-columns:repeat(3,1fr)}
.grid.cols-4{grid-template-columns:repeat(4,1fr)}
@media (max-width:960px){ .grid.cols-3,.grid.cols-4{grid-template-columns:1fr 1fr} }
@media (max-width:640px){ .grid.cols-3,.grid.cols-4{grid-template-columns:1fr} }

/* ===== Cards ===== */
.card{
  background:var(--card); border:1px solid var(--border);
  border-radius:var(--radius); overflow:hidden;
  display:flex; flex-direction:column;
}
/* 기본: 배너/스크린샷 → cover */
.card .thumb{ aspect-ratio:16/9; background:#0c1e2d; }
.card .thumb img{ width:100%; height:100%; object-fit:cover; }
/* 로고형 썸네일이 필요할 때만 .logo 수정자 사용 */
.card .thumb.logo{
  background:#1d273c; display:flex; align-items:center; justify-content:center;
  padding:8px; box-sizing:border-box;
}
.card .thumb.logo img{ object-fit:contain; }

.card .body{padding:14px}
.card h3 a{color:inherit; text-decoration:none}
.card h3 a:hover{text-decoration:underline}
.badge{
  font-size:12px; color:#001018; background:var(--primary);
  display:inline-block; padding:4px 8px; border-radius:999px; font-weight:700; margin-right:6px;
}
.meta{color:var(--sub); font-size:12px; margin-top:6px}

/* ===== Tables ===== */
.table{width:100%; border-collapse:collapse; overflow:hidden; border-radius:12px}
.table th,.table td{padding:12px; border-bottom:1px solid var(--border); text-align:left}
.table th{color:var(--sub); font-weight:600; background:#0e141e}
.table .btn{
  white-space:nowrap; display:inline-flex; align-items:center; justify-content:center;
  padding:6px 14px; font-size:0.9rem; min-width:100px; box-sizing:border-box;
}

/* ===== Footer ===== */
footer{margin-top:24px; padding:24px 0; color:var(--sub); border-top:1px solid var(--border)}
footer .footer-text { font-size: 0.9rem; line-height: 1.5; color: var(--sub); }
footer .footer-text p { margin: 8px 0; }

/* ===== RTL support ===== */
[dir="rtl"] body,[dir="rtl"] .nav,[dir="rtl"] .section-head{direction:rtl}
[dir="rtl"] .nav{flex-direction:row-reverse}
[dir="rtl"] .cta{margin-right:auto;margin-left:0}
[dir="rtl"] .nav-links{flex-direction:row-reverse}

/* ===== Images / fade-in ===== */
/* 기존 lazy 전용 + 클래스 기반 둘 다 지원(점진적 이전) */
img[loading="lazy"], .fade-img { opacity:0; transition:opacity .3s ease-in; }
img[loading="lazy"].loaded, .fade-img.loaded { opacity:1; }

/* ===== Typography ===== */
body, .sub, p, li { line-height: 1.65; }

/* ===== Generic content image wrapper ===== */
.image-container{
  display:flex; justify-content:center;
  margin-top:40px; margin-bottom:60px;
}
.image-container img{
  width:50%; max-width:600px;
  border-radius:12px; border:1px solid var(--border);
}
@media (max-width: 768px){
  .image-container img{ width:100%; max-width:100%; }
}

/* ===== List page (Top Casinos, FAQ) ===== */
.list-page .casino-list h2 { font-size: 1.8rem; margin: 20px 0; }
.list-page .table         { font-size: 1.15rem; }
.list-page .table td,
.list-page .table th      { padding: 18px 14px; }
.list-page .table td:first-child img{
  width:140px; max-height:90px; border-radius:14px;
}
.list-page .table .btn{ font-size:1.05rem; padding:10px 16px; min-width:120px; }

/* 별점 (리스트 전용 렌더) */
.casino-list .stars{ display:inline-flex; gap:4px; vertical-align:middle; }
.casino-list .star{ width:22px; height:22px; display:block; }
.casino-list .star path{ shape-rendering:geometricPrecision; }
.casino-list .star.full path { fill: gold; }
.casino-list .star.base path { fill: #9aa3b2; }
.casino-list .star.fill path { fill: gold; }
.casino-list .star-wrap{ position:relative; width:22px; height:22px; display:inline-block; }
.casino-list .star.fill.half{ position:absolute; inset:0; clip-path: inset(0 50% 0 0); }
.casino-list td.rating{ white-space:nowrap; }

/* ===== FAQ banner ===== */
.faq-banner{
  display:grid; place-items:center; width:100%; margin:16px auto 24px;
}
.faq-banner__img{
  width:min(100%, 800px); /* 720 → 800 */
  height:auto; display:block; margin:0 auto;
  border-radius:12px; border:1px solid var(--border);
}

/* ===== Center text logo (unified) ===== */
/* 기존 .faq-logo / .casino-logo / .site-logo-center 모두 지원 */
.logo-center,
.faq-logo,
.casino-logo,
.site-logo-center{
  text-align:center; margin:40px 0 20px;
}
.logo-center .logo-text,
.faq-logo .logo-text,
.casino-logo .logo-text,
.site-logo-center .logo-text{
  font-weight:700; text-decoration:none;
  font-size: clamp(1.6rem, 1.2rem + 1vw, 2.4rem);
}
.logo-center .brand-blockchain,
.faq-logo .brand-blockchain,
.casino-logo .brand-blockchain,
.site-logo-center .brand-blockchain{ color:#2ea3f2; }
.logo-center .brand-casino,
.faq-logo .brand-casino,
.casino-logo .brand-casino,
.site-logo-center .brand-casino{ color:#6ddc6d; }
.logo-center .brand-hub,
.faq-logo .brand-hub,
.casino-logo .brand-hub,
.site-logo-center .brand-hub{ color:#f26dc0; }
.logo-center .brand-dotcom,
.faq-logo .brand-dotcom,
.casino-logo .brand-dotcom,
.site-logo-center .brand-dotcom{ color:#ffffff; opacity:.95; }



.img-link{display:inline-block;padding:0;background:transparent;border:0;line-height:0} .img-link img{display:block} /* keep an accessible focus ring */ .img-link:focus-visible{outline:2px solid var(--primary);outline-offset:4px;border-radius:8px}



/* Dropdown container */
.nav-links .nav-dropdown{position:relative;display:inline-block}

/* Toggle button (looks like a normal nav item) */
.nav-links .nav-dropdown__toggle{
  background:transparent;border:0;color:inherit;font:inherit;cursor:pointer;
  padding:8px 10px;border-radius:8px;display:inline-flex;align-items:center;gap:.35rem
}
.nav-links .nav-dropdown__toggle:focus-visible{
  outline:2px solid var(--primary);outline-offset:2px
}

/* Menu panel */
 .nav-links .nav-dropdown__menu{
   position:absolute;top:100%;left:0;min-width:220px;margin-top:6px;
   background:var(--card);border:1px solid var(--border);border-radius:12px;
   padding:6px;list-style:none;display:none;z-index:30;
   box-shadow:0 10px 24px rgba(0,0,0,.25)
 }
.nav-links .nav-dropdown__menu a{
  display:block;padding:8px 10px;border-radius:8px;text-decoration:none
}
.nav-links .nav-dropdown__menu a:hover,
.nav-links .nav-dropdown__menu a:focus{
  background:rgba(255,255,255,.06);outline:0
}

/* Open state */
.nav-links .nav-dropdown.open .nav-dropdown__menu{display:block}

/* Mobile: make menu flow in the nav stack */
@media (max-width: 900px){
  .nav-links .nav-dropdown__menu{
    position:static;box-shadow:none;margin-top:6px
  }
}

@media (max-width: 720px){
  .nav-links .nav-dropdown{ border-bottom:1px solid var(--border); }
  .nav-links .nav-dropdown__toggle{ width:100%; justify-content:space-between; padding:8px 0; }
  .nav-links .nav-dropdown__menu a{ padding:10px 12px; }
}

/* Keep header menu items on one line (desktop) and prevent shrinking */
.nav-links a,
.nav-links .nav-dropdown__toggle { white-space: nowrap; }
.nav-links a,
.nav-links .nav-dropdown { flex-shrink: 0; }

/* On small screens (stacked menu), allow normal wrapping */
@media (max-width: 720px) {
  .nav-links a,
  .nav-links .nav-dropdown__toggle { white-space: normal; }
}

/* Make dropdown toggle text match other nav links */
.nav-links .nav-dropdown__toggle{
  font-weight:700;                                  /* same weight as links */
  font-size:clamp(0.9rem, 0.75rem + 0.35vw, 1.05rem); /* same size as links */
  line-height:1;
  padding:8px 0;                                   /* align vertical rhythm with links */
}

.nav-links .nav-dropdown__toggle:hover{
  color:var(--text);                               /* same hover color as links */
}

/* Prevent flicker between toggle and menu */
.nav-links .nav-dropdown::after{
  content:"";
  position:absolute;
  top:100%;
  left:0;
  right:0;
  height:10px;               /* >= menu gap (margin-top:6px) */
  /* no background; acts as invisible hover bridge */
}
/* --- Dropdown hover bridge (desktop only) ---
   Prevents the menu from closing when the cursor moves
   from the toggle button to the dropdown panel. */
@media (min-width: 901px){
  .nav-links .nav-dropdown{ position: relative; } /* ensure positioning context */

  .nav-links .nav-dropdown::after{
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;         /* just below the toggle */
    height: 12px;      /* bridge height; increase to 14–16px if still flickers */
    z-index: 29;       /* below the menu (menu uses z-index:30) */
    background: transparent;
    /* pointer-events is "auto" by default, which is what we want
       so the area counts as being inside the dropdown. */
  }
}

.nav-links .nav-dropdown.open .nav-dropdown__menu { display: block; }