/**
 * goigoi Prototype - Core Styles (v4)
 * Generic puzzle components and site-wide styling.
 */

@import url("./fonts.css");

:root {
  /* Colors */
  --bg-warm-white: #F7F5F2;
  --text-charcoal: #202020;
  --brand-red: #9B111E;
  --font-ui-base: var(--gg-font-ui-base, "Plus Jakarta Sans", "Noto Sans", "Segoe UI", Arial, sans-serif);
  --font-ui-ja: var(--gg-font-ui-ja, "Plus Jakarta Sans", "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", "Meiryo", "Segoe UI", sans-serif);
  --font-ui-ko: var(--gg-font-ui-ko, "Plus Jakarta Sans", "Pretendard Variable", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Segoe UI", sans-serif);
  --font-ui-vi: var(--gg-font-ui-vi, var(--font-ui-base));
  
  /* Domain Specific Colors */
  --color-dictionary: #9B111E;
  --color-ai: #34495E;
  --color-game: #166D5D;
  --color-study: #5D6D37;
  --color-reserve1: #8E6E26;
  
  /* Default Context */
  --domain-color: var(--brand-red);

  /* PC Size: Slightly more compact */
  --pz-w: 160px;
  --pz-h: 125px;
  --pz-bump: 36px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background-color: var(--bg-warm-white); color: var(--text-charcoal); font-family: var(--font-ui-base); line-height: 1.6; }
html[lang="ja"] body,
body:lang(ja) { font-family: var(--font-ui-ja); }
html[lang="ko"] body,
body:lang(ko) { font-family: var(--font-ui-ko); }
html[lang="vi"] body,
body:lang(vi) { font-family: var(--font-ui-vi); }
a { color: inherit; text-decoration: none; }

/* --- REUSABLE PUZZLE COMPONENT --- */
.pz-container {
  display: grid;
  grid-template-columns: repeat(3, auto); 
  justify-content: center;
  gap: 20px 0;
  padding: 20px 0;
  transform: translateX(-10px); 
}

.pz-piece {
  width: var(--pz-w);
  height: var(--pz-h);
  background: color-mix(in srgb, var(--domain-color), #fff 88%);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--domain-color), transparent 85%);
  z-index: 1;
  margin-right: calc(var(--pz-bump) * -0.6); 
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  padding-left: 8px;
}

.pz-piece:nth-child(3n+1) { z-index: 30; }
.pz-piece:nth-child(3n+2) { z-index: 20; }
.pz-piece:nth-child(3n+3) { z-index: 10; }

.pz-piece:hover {
  background: color-mix(in srgb, var(--domain-color), #fff 75%);
  transform: translateY(-10px) scale(1.05);
  z-index: 1000 !important;
  box-shadow: 0 15px 35px rgba(0,0,0,0.1);
  border-color: var(--domain-color);
}

.pz-piece::before {
  content: "";
  position: absolute;
  right: calc(var(--pz-bump) * -0.5 - 1px);
  top: 50%;
  transform: translateY(-50%);
  width: calc(var(--pz-bump) + 2px);
  height: calc(var(--pz-bump) + 2px);
  background: color-mix(in srgb, var(--domain-color), transparent 80%);
  border-radius: 50%;
  z-index: -2;
  clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
}

.pz-piece::after {
  content: "";
  position: absolute;
  right: calc(var(--pz-bump) * -0.5);
  top: 50%;
  transform: translateY(-50%);
  width: var(--pz-bump);
  height: var(--pz-bump);
  background: inherit;
  border-radius: 50%;
  z-index: -1;
  clip-path: polygon(46% 0, 100% 0, 100% 100%, 46% 100%);
}

.pz-piece:hover::before {
  background: var(--domain-color);
}

.pz-piece:hover::after {
  background: inherit;
}

.pz-piece .icon { width: 36px; height: 36px; margin-bottom: 6px; margin-top: -12px; display: flex; align-items: center; justify-content: center; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); filter: drop-shadow(0 4px 8px rgba(0,0,0,0.12)); }
.pz-piece .icon svg { width: 100%; height: 100%; color: var(--domain-color); }
.pz-piece:hover .icon { transform: scale(1.2) rotate(-5deg); filter: drop-shadow(0 0 12px color-mix(in srgb, var(--domain-color), transparent 60%)); }
.pz-piece .label { font-weight: 900; font-size: calc(var(--pz-w) * 0.12); color: var(--domain-color); line-height: 1.0; margin-bottom: 4px; letter-spacing: -0.02em; }
.pz-piece .desc { font-size: 0.75rem; color: #444; text-align: center; padding: 0 8px; line-height: 1.1; font-weight: 600; }

/* --- DOMAIN THEMES --- */
.domain-dictionary { --domain-color: var(--color-dictionary); }
.domain-ai         { --domain-color: var(--color-ai); }
.domain-game       { --domain-color: var(--color-game); }
.domain-study      { --domain-color: var(--color-study); }
.domain-reserve1   { --domain-color: var(--color-reserve1); }

/* --- BADGES --- */
.badge {
  position: absolute;
  top: -15px; right: -15px;
  padding: 8px 20px;
  font-size: 1.1rem;
  font-weight: 900;
  border-radius: 20px;
  background: var(--brand-red);
  color: #fff;
  text-transform: uppercase;
  box-shadow: 0 5px 15px rgba(0,0,0,0.25);
  z-index: 60;
  border: 3px solid #ffffff;
}
.badge-ai { background: linear-gradient(135deg, #E6B800 0%, #B88600 100%) !important; }
.badge-new { background: linear-gradient(135deg, #FF4500 0%, #CC0000 100%) !important; }

/* --- UNIFIED SITE NAVIGATION (TAB STYLE) --- */
.site-nav-bar { background: #fff; border-bottom: 1px solid rgba(0,0,0,0.08); }
.nav-tabs { display: flex; justify-content: center; }
.nav-tab { 
    display: grid;
    grid-template-areas: "icon label" "icon desc";
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 10px;
    padding: 8px 18px;
    color: #666;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    text-align: left;
    position: relative;
    font-family: var(--font-ui-base);
}
.nav-tab:not(:last-child)::after {
    content: "";
    position: absolute;
    right: 0; top: 50%; transform: translateY(-50%);
    width: 1px; height: 24px; background: rgba(0,0,0,0.08);
}
.nav-tab:hover { background: rgba(0,0,0,0.02); color: var(--domain-color, var(--brand-red)); }
.nav-tab.active { 
    border-bottom-color: var(--domain-color, var(--brand-red)); 
    color: var(--domain-color, var(--brand-red));
    background: color-mix(in srgb, var(--domain-color, var(--brand-red)), transparent 96%);
}
.nav-tab .icon { grid-area: icon; width: 20px; height: 20px; }
.nav-tab .icon svg { width: 100%; height: 100%; color: inherit; }
.nav-tab .label { grid-area: label; font-size: 0.85rem; font-weight: 800; line-height: 1.1; font-family: var(--font-ui-base); }
.nav-tab .desc { grid-area: desc; font-size: 0.65rem; color: #999; font-weight: 500; white-space: nowrap; margin-top: -1px; font-family: var(--font-ui-base); }

/* --- LANGUAGE SELECTOR --- */
.lang-selector { position: relative; }
.lang-flat-trigger { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 0 10px; border-radius: 8px; transition: 0.3s; height: 44px; }
.lang-flat-trigger:hover { background: rgba(0,0,0,0.03); }
.lang-flat-list { display: flex; gap: 4px; align-items: center; }
.lang-dot { width: 18px; height: 18px; border-radius: 3px; overflow: hidden; border: 1px solid rgba(0,0,0,0.1); display: flex; align-items: center; justify-content: center; background: #fff; flex-shrink: 0; }
.lang-dot svg { width: 100%; height: 100%; display: block; }

.lang-dropdown { position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(10px); background: #fff; border: 1px solid rgba(0,0,0,0.08); box-shadow: 0 10px 30px rgba(0,0,0,0.1); border-radius: 10px; width: 160px; opacity: 0; visibility: hidden; transition: 0.3s; padding: 6px; z-index: 1000; }
.lang-selector:hover .lang-dropdown { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(5px); }
.lang-option { display: flex; align-items: center; padding: 8px 12px; width: 100%; border: none; background: transparent; cursor: pointer; border-radius: 6px; font-size: 0.85rem; color: #444; transition: 0.2s; }
.lang-option:hover { background: var(--bg-warm-white); color: var(--brand-red); }

/* --- AUTH PANEL --- */
.auth-selector { position: relative; }
.utility-auth { gap: 8px; border-radius: 999px; cursor: pointer; transition: background 0.2s ease, color 0.2s ease; }
.utility-auth:hover { background: rgba(0,0,0,0.03); }
.utility-auth[data-auth-state="login"] { color: var(--domain-color, var(--brand-red)); }
.utility-auth[data-auth-state="paid"] { color: #8E6E26; }
.auth-plan-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.06);
  color: #666;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.utility-auth[data-auth-state="login"] .auth-plan-pill {
  background: color-mix(in srgb, var(--domain-color, var(--brand-red)), transparent 88%);
  color: var(--domain-color, var(--brand-red));
}
.utility-auth[data-auth-state="paid"] .auth-plan-pill {
  background: color-mix(in srgb, var(--color-reserve1), transparent 84%);
  color: var(--color-reserve1);
}
.auth-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(320px, calc(100vw - 24px));
  padding: 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
  z-index: 1200;
}
.auth-dropdown[hidden] { display: none !important; }
.auth-dropdown [hidden] { display: none !important; }
.auth-dropdown-head { padding-bottom: 12px; border-bottom: 1px solid rgba(0,0,0,0.06); }
.auth-dropdown-title { font-size: 0.92rem; font-weight: 900; color: #222; }
.auth-dropdown-meta { margin-top: 6px; font-size: 0.8rem; line-height: 1.5; color: #666; }
.auth-dropdown-actions { display: grid; gap: 10px; padding-top: 12px; }
.auth-email-form {
  display: grid;
  gap: 8px;
}
.auth-email-note {
  color: #666;
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1.45;
}
.auth-field {
  display: grid;
  gap: 4px;
  color: #444;
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.25;
}
.auth-input {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid rgba(0,0,0,0.14);
  border-radius: 8px;
  background: #fff;
  color: #222;
  font: inherit;
  font-size: 0.9rem;
  outline: none;
}
.auth-input:focus {
  border-color: color-mix(in srgb, var(--domain-color, var(--brand-red)), transparent 25%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--domain-color, var(--brand-red)), transparent 88%);
}
.auth-input:disabled {
  background: rgba(0,0,0,0.04);
  color: #777;
}
.auth-action {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.08);
  background: #fff;
  color: #333;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.auth-action:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(0,0,0,0.08);
}
.auth-action:disabled { opacity: 0.55; cursor: not-allowed; }
.auth-action-primary {
  background: linear-gradient(135deg, var(--brand-red) 0%, #b01a28 100%);
  border-color: transparent;
  color: #fff;
}
.auth-action-email {
  background: #fff;
  border-color: color-mix(in srgb, var(--brand-red), transparent 70%);
  color: var(--brand-red);
}
.auth-action-logout {
  background: #fff;
  color: #444;
}
.auth-action-delete-request {
  background: #fff;
  border-color: color-mix(in srgb, var(--brand-red), transparent 58%);
  color: var(--brand-red);
}
.auth-email-status,
.auth-delete-status {
  min-height: 0;
  color: #666;
  font-size: 0.74rem;
  font-weight: 750;
  line-height: 1.45;
}
.auth-email-status:empty,
.auth-delete-status:empty { display: none; }
.auth-email-status[data-status="pending"],
.auth-delete-status[data-status="pending"] { color: #555; }
.auth-email-status[data-status="error"],
.auth-delete-status[data-status="error"] { color: var(--brand-red); }
.auth-delete-status[data-status="success"] { color: #1d6f3b; }
.flag-sq { width: 18px; height: 18px; border-radius: 3px; overflow: hidden; margin-right: 10px; border: 1px solid rgba(0,0,0,0.05); flex-shrink: 0; }
.flag-sq svg { width: 100%; height: 100%; display: block; }

/* --- GAME DOMAIN COMPONENTS --- */
.pz-hero-style {
    position: relative;
    margin: 20px 0 50px;
    min-height: 300px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; color: #fff; padding: 60px 20px; border-radius: 20px; overflow: hidden; background: var(--domain-color, var(--color-game));
}
.hero-bg-img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; z-index: 1; }
.hero-bg-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.55); z-index: 2; }
.game-hero-content { position: relative; z-index: 10; display: flex; flex-direction: column; align-items: center; width: 100%; }
.hero-icon-wrap {
    width: 80px; height: 80px; background: #fff;
    border-radius: 24px; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; 
    color: var(--domain-color, var(--brand-red)); 
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 10;
}
.hero-icon-wrap svg { width: 44px; height: 44px; display: block; fill: currentColor !important; stroke: none; }
.game-hero-content h1 { font-size: 3rem; font-weight: 900; margin-bottom: 10px; color: #fff; }
.game-hero-content p { font-size: 1.2rem; max-width: 600px; margin: 0 auto; line-height: 1.4; }

.section-label { font-size: 1.2rem; font-weight: 900; color: var(--domain-color, var(--brand-red)); margin: 40px 0 20px; display: flex; align-items: center; gap: 10px; }
.section-label::before { content: ""; width: 4px; height: 20px; background: currentColor; border-radius: 2px; }

.recommended-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 50px; }
.recommended-box {
    background: #fff; border-radius: 20px; padding: 20px; border: 1px solid rgba(0,0,0,0.05);
    display: flex; gap: 20px; align-items: center; box-shadow: 0 10px 25px rgba(0,0,0,0.03); transition: 0.3s;
}
.recommended-box:hover { transform: translateY(-5px); border-color: var(--color-game); }
.rec-img { width: 100px; height: 100px; background: #eee; border-radius: 12px; flex-shrink: 0; background-size: cover; background-position: center; }

.game-card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 60px; }
.game-card-v2 { background: #fff; border-radius: 18px; overflow: hidden; border: 1px solid rgba(0,0,0,0.05); display: flex; flex-direction: column; transition: 0.3s; }
.game-card-v2:hover { transform: translateY(-5px); border-color: var(--color-game); }
.game-card-thumb { width: 100%; aspect-ratio: 1/1; background: #f0f0f0; background-size: cover; background-position: center; }
.game-card-body { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.game-card-title { font-size: 1.1rem; font-weight: 900; margin-bottom: 8px; color: #222; }
.game-card-desc { font-size: 0.8rem; color: #666; margin-bottom: 15px; line-height: 1.5; flex-grow: 1; }
.game-meta { display: flex; flex-direction: column; gap: 8px; padding-top: 15px; border-top: 1px solid #f4f4f4; }
.meta-row { display: flex; align-items: center; justify-content: space-between; font-size: 0.75rem; }
.meta-label { color: #999; font-weight: 600; }
.meta-value { color: #444; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.meta-flags { display: flex; gap: 3px; align-items: center; }
.meta-flags .flag-mini { width: 14px; height: 14px; border-radius: 2px; overflow: hidden; border: 1px solid rgba(0,0,0,0.05); }
.meta-flags svg { width: 100%; height: 100%; display: block; }
.difficulty-stars { color: #FFB800; letter-spacing: 2px; }
.target-badge { background: color-mix(in srgb, var(--color-game), transparent 90%); color: var(--color-game); padding: 2px 8px; border-radius: 4px; }

/* --- DICTIONARY DOMAIN COMPONENTS --- */
.dict-search-section { padding: 40px 0; text-align: center; }
.dict-search-wrapper { position: relative; max-width: 700px; margin: 0 auto; display: flex; gap: 10px; z-index: 100; }
.dict-search-input { 
    flex: 1; padding: 18px 25px; border-radius: 50px; border: 2px solid #eee; 
    font-size: 1.1rem; transition: 0.3s; background: #fff; box-shadow: 0 5px 15px rgba(0,0,0,0.03);
}
.dict-search-input:focus { outline: none; border-color: var(--color-dictionary); box-shadow: 0 10px 25px rgba(155, 17, 30, 0.1); }
.dict-search-btn { 
    padding: 0 35px; border-radius: 50px; background: var(--color-dictionary); 
    color: #fff; border: none; font-weight: 900; cursor: pointer; transition: 0.3s;
}
.dict-search-btn:hover { background: #7d0d18; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }

.advanced-search-link { 
    display: inline-block; margin-top: 15px; font-size: 0.85rem; color: #666; 
    text-decoration: underline; cursor: pointer; opacity: 0.8; transition: 0.2s;
}
.advanced-search-link:hover { opacity: 1; color: var(--color-dictionary); }

.advanced-search-panel { 
    max-width: 700px; margin: 0 auto; background: #fff; border: 1px solid #eee; 
    border-radius: 0 0 20px 20px; padding: 25px; margin-top: -20px; /* Overlap with search bar */
    display: none; /* Toggle via JS */
    text-align: left; box-shadow: 0 15px 30px rgba(0,0,0,0.05);
    animation: slideDown 0.3s ease-out;
}
@keyframes slideDown { from { transform: translateY(-10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.adv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.adv-group { display: flex; flex-direction: column; gap: 8px; }
.adv-label { font-size: 0.75rem; font-weight: 800; color: #999; text-transform: uppercase; }
.adv-select { padding: 8px; border-radius: 6px; border: 1px solid #ddd; font-size: 0.85rem; background: #fcfcfc; }

.dict-banner-slot { 
    display: flex; align-items: center; background: #fff; border-radius: 12px; 
    padding: 15px 25px; margin-bottom: 30px; border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}
.dict-banner-tag { 
    background: var(--color-dictionary); color: #fff; border-radius: 4px; 
    padding: 4px 10px; font-size: 0.7rem; font-weight: 900; margin-right: 15px; text-transform: uppercase;
}

.dict-axis-tabs { display: flex; justify-content: center; gap: 30px; border-bottom: 2px solid #eee; margin-bottom: 30px; }
.dict-axis-tab { 
    padding: 15px 5px; font-weight: 900; color: #999; cursor: pointer; 
    position: relative; transition: 0.3s; font-size: 1rem;
}
.dict-axis-tab:hover { color: #666; }
.dict-axis-tab.active { color: var(--color-dictionary); }
.dict-axis-tab.active::after { 
    content: ""; position: absolute; bottom: -2px; left: 0; width: 100%; 
    height: 3px; background: var(--color-dictionary); border-radius: 3px;
}

.alphabet-index { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 30px; }
.alpha-letter { 
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; 
    background: #fff; border: 1px solid #eee; border-radius: 50%; font-weight: 800; 
    font-size: 0.9rem; cursor: pointer; transition: 0.2s; color: #666;
}
.alpha-letter:hover, .alpha-letter.active { background: var(--color-dictionary); border-color: var(--color-dictionary); color: #fff; }

.dict-result-list { display: grid; grid-template-columns: 1fr; gap: 12px; }
.dict-word-card { 
    background: #fff; padding: 20px 25px; border-radius: 12px; display: flex; 
    flex-direction: column; align-items: stretch; border: 1px solid rgba(0,0,0,0.03); 
    transition: 0.2s; position: relative; gap: 8px;
}
.dict-word-card:hover { transform: translateX(5px); border-color: var(--color-dictionary); box-shadow: 0 4px 15px rgba(0,0,0,0.04); }

.word-header { display: flex; align-items: baseline; gap: 12px; }
.word-vi { font-size: 1.4rem; font-weight: 900; color: var(--color-dictionary); }
.word-pos { font-size: 0.75rem; font-weight: 700; color: #999; text-transform: uppercase; background: #f8f8f8; padding: 2px 8px; border-radius: 4px; }

.word-meaning { font-size: 1rem; color: #555; font-weight: 500; line-height: 1.4; }

.word-actions { display: flex; gap: 8px; margin-top: 4px; }
.btn-icon { 
    background: #f8f8f8; border: none; width: 32px; height: 32px; border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; color: #666;
}
.btn-icon:hover { background: var(--color-dictionary); color: #fff; }
.btn-icon .icon { width: 16px; height: 16px; }

/* Lexical Entry Pathway Style */
.dict-word-card.is-lexical { 
    border-left: 4px solid #ddd; 
    background: linear-gradient(to right, #fcfcfc, #fff);
}
.dict-word-card.is-lexical .word-vi { color: #888; }
.dict-word-card.is-lexical .word-meaning { color: #999; font-style: italic; font-size: 0.85rem; }
.dict-word-card.is-lexical:hover { border-color: #ccc; border-left-color: var(--color-dictionary); }

.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 15px; padding: 20px 0; }
.topic-card { background: #fff; border: 1px solid #eee; border-radius: 12px; padding: 20px; text-align: center; transition: 0.2s; cursor: pointer; }
.topic-card:hover { border-color: var(--color-dictionary); transform: translateY(-3px); }
.topic-icon { font-size: 1.5rem; margin-bottom: 10px; display: block; }
.topic-name { font-size: 0.85rem; font-weight: 700; color: #444; }

.level-list { display: flex; justify-content: center; gap: 15px; padding: 20px 0; }
.level-badge { padding: 10px 25px; border-radius: 50px; background: #fff; border: 2px solid #eee; font-weight: 900; color: #666; cursor: pointer; transition: 0.2s; }
.level-badge:hover, .level-badge.active { border-color: var(--color-dictionary); color: var(--color-dictionary); }

@media (max-width: 600px) {
    .dict-search-wrapper { flex-direction: column; gap: 10px; }
    .dict-search-input { font-size: 1rem; padding: 15px 20px; text-align: center; }
    .dict-search-btn { padding: 12px; }
    .dict-axis-tabs { gap: 15px; }
    .dict-axis-tab { padding: 10px 5px; font-size: 0.85rem; }
    .alpha-letter { width: 30px; height: 30px; font-size: 0.8rem; }
    .word-vi { font-size: 1.1rem; min-width: 60px; }
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; width: 100%; }
header.site-header { padding: 15px 0; background: #fff; border-bottom: 1px solid rgba(0,0,0,0.05); }
.header-inner { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 0 20px; }
.site-logo { font-size: 1.5rem; font-weight: bold; color: var(--brand-red); }
.utility-nav { display: flex; align-items: center; gap: 10px; }
.utility-item { display: flex; align-items: center; min-height: 44px; padding: 0 10px; border: 0; background: transparent; color: inherit; font: inherit; }
.utility-settings { border-radius: 999px; transition: background 0.2s ease, color 0.2s ease; }
.utility-settings:hover { background: rgba(0,0,0,0.03); color: var(--domain-color, var(--brand-red)); }
.icon-nav { width: 20px; height: 20px; stroke: #666; fill: none; stroke-width: 2; }

/* --- STATIC INFO PAGES --- */
.static-info-page {
  width: min(960px, calc(100% - 32px));
  padding-top: 64px;
}
.static-info-hero {
  padding: 0 0 34px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.static-info-kicker {
  margin-bottom: 10px;
  color: var(--domain-color, var(--brand-red));
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.static-info-hero h1 {
  max-width: 760px;
  font-size: clamp(2rem, 2.6rem, 3.4rem);
  line-height: 1.06;
  font-weight: 950;
}
.static-info-intro {
  max-width: 720px;
  margin-top: 18px;
  color: #555;
  font-size: 1.05rem;
  line-height: 1.8;
}
.static-info-content {
  display: grid;
  gap: 34px;
  padding-top: 38px;
}
.static-info-section h2 {
  margin-bottom: 12px;
  font-size: 1.2rem;
  font-weight: 900;
}
.static-info-section p,
.static-info-section li {
  max-width: 760px;
  color: #555;
  font-size: 0.98rem;
  line-height: 1.8;
}
.static-info-section p + p { margin-top: 10px; }
.static-info-section ul {
  display: grid;
  gap: 8px;
  margin-left: 1.2rem;
}
.static-info-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 42px;
}
.static-info-action {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  color: var(--domain-color, var(--brand-red));
  font-size: 0.9rem;
  font-weight: 850;
  box-shadow: 0 10px 24px rgba(0,0,0,0.04);
}
.static-info-action:hover {
  background: color-mix(in srgb, var(--domain-color, var(--brand-red)), #fff 92%);
}

.gg-content-disclosure {
  width: min(920px, calc(100% - 32px));
  margin: 18px auto 26px;
  border: 1px solid rgba(47, 65, 86, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: #334155;
  font-size: 0.85rem;
  line-height: 1.55;
  box-shadow: 0 8px 20px rgba(47, 65, 86, 0.08);
}
.gg-content-disclosure summary {
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 850;
}
.gg-content-disclosure__body {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}
.gg-content-disclosure__body p {
  margin: 0;
}
.gg-content-disclosure__links a {
  color: var(--domain-color, var(--brand-red));
  font-weight: 850;
}

.gg-content-disclosure--game {
  width: min(680px, calc(100% - 40px));
  margin: 10px auto 14px;
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(47, 65, 86, 0.1);
  box-shadow: none;
  font-size: 0.76rem;
  opacity: 0.72;
}
.gg-content-disclosure--game[open] {
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.82);
}
.gg-content-disclosure--game summary {
  padding: 6px 8px;
}
.gg-content-disclosure--game .gg-content-disclosure__body {
  gap: 5px;
  padding: 0 8px 8px;
}

/* --- MOBILE OPTIMIZATION --- */
@media (max-width: 768px) {
  .container { padding: 0 15px; }
  .header-inner { padding: 0 15px; }
  
  /* Hide flags on mobile, show only globe */
  .lang-flat-list { display: none !important; }
  .lang-flat-trigger { padding: 0 5px; gap: 0; }
  .utility-auth { gap: 4px; }
  #site-auth-label { display: none; }
  .auth-dropdown {
    position: fixed;
    top: 64px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100dvh - 78px);
    overflow: auto;
  }
  .auth-plan-pill {
    max-width: 68px;
    padding: 2px 7px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-transform: none;
  }
  
  .pz-container {
    --pz-w: min(150px, calc((100vw - 44px) / 2));
    --pz-h: 118px;
    --pz-bump: 28px;
    grid-template-columns: repeat(2, minmax(0, var(--pz-w)));
    transform: none;
    gap: 10px 8px;
  }
  .pz-piece {
    width: var(--pz-w);
    height: var(--pz-h);
    margin-right: 0;
    padding-left: 0;
  }
  .pz-piece:nth-child(2n+1) { z-index: 30; }
  .pz-piece:nth-child(2n) { z-index: 20; }
  .pz-piece .icon { width: 32px; height: 32px; margin-top: -8px; }
  .pz-piece .desc { font-size: 0.72rem; }
  .site-nav-bar { overflow-x: clip; }
  .site-nav-bar .container {
    overflow-x: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
  }
  .nav-tabs {
    justify-content: space-between;
    width: 100%;
    overflow-x: hidden;
    padding: 0 4px;
  }
  .nav-tab {
    display: flex;
    flex-direction: column;
    padding: 8px 4px;
    gap: 4px;
    flex: 1;
    text-align: center;
    align-items: center;
    justify-content: center;
  }
  .nav-tab:not(:last-child)::after { display: none; }
  .nav-tab .desc { display: none; }
  .nav-tab .label { font-size: 0.7rem; }
  .section-header-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px;
  }
  .sort-controls {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    justify-content: flex-start !important;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }
  .sort-link {
    flex: 0 0 auto;
    padding: 6px 12px !important;
    white-space: nowrap;
  }
  
  .game-hero-content h1 { font-size: 2.2rem; }
  .recommended-grid { grid-template-columns: 1fr; }
  .recommended-box { flex-direction: column; text-align: center; }
  
  .game-card-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .game-card-body { padding: 12px; }
  .game-card-title { font-size: 0.95rem; }
  .meta-row { flex-direction: column; align-items: flex-start; gap: 2px; }
}

/* --- TOP PAGE HERO --- */
.hero {
  text-align: center;
  padding: 80px 20px 60px;
  max-width: 900px;
  margin: 0 auto 40px;
}
.hero h1 {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 20px;
  color: var(--brand-red);
  word-break: keep-all;
}
.hero p {
  font-size: 1.3rem;
  color: #555;
  line-height: 1.6;
  font-weight: 500;
}
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1.1rem; }
}

/* --- Shared search bar (site top + word top) --- */
/* search title carries the vocabulary-page marker identity (ink text + red marker band), matching /word/ .word-title */
.v2-search-label{display:table; margin:0 auto 12px; padding:0 .14em; color:var(--text-charcoal,#202020); font-size:clamp(1.5rem,3.3vw,2.1rem); font-weight:900; line-height:1.16; letter-spacing:0; background:linear-gradient(transparent 56%, rgba(155,17,30,.16) 56%); border-radius:4px}
.v2-search-form{width:100%; max-width:540px; margin:0 auto; display:flex; background:#fff; border-radius:12px; border:2px solid #ddd; padding:4px 6px; box-shadow:0 4px 12px rgba(0,0,0,.04); align-items:center; transition:.2s} /* radius matches jigsaw piece (.pz-piece 12px) */
.v2-search-form:focus-within{border-color:var(--color-dictionary); box-shadow:0 6px 16px rgba(155,17,30,.1)}
.v2-search-input{flex:1; min-width:0; border:none; outline:none; padding:10px 14px; font-size:1.05rem; background:transparent; color:#333}
.v2-search-btn{background:var(--color-dictionary); color:#fff; border:none; cursor:pointer; display:flex; align-items:center; justify-content:center; width:42px; height:42px; border-radius:8px; flex-shrink:0; transition:.2s}
.v2-search-btn:hover{transform:scale(1.05); background:#7d0d18}
.v2-search-hint{max-width:620px; margin:10px auto 0; color:#665e57; font-size:.86rem; line-height:1.45; text-align:center}
.v2-search-trending{margin-top:16px; font-size:.8rem; color:#666; display:flex; gap:8px; justify-content:center; flex-wrap:wrap; align-items:center}
.v2-search-trending .label{font-weight:800; font-size:.75rem; text-transform:uppercase}
.v2-search-trending a{background:#fff; border:1px solid #e5e5ea; padding:2px 10px; border-radius:12px; transition:.2s}
.v2-search-trending a:hover{border-color:var(--color-dictionary); color:var(--color-dictionary)}

footer { margin-top: 80px; padding: 40px; text-align: center; font-size: 0.8rem; color: #888; }



/* Rich Feature Card V2 */
.game-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 60px;
}

@media (max-width: 900px) {
    .game-card-grid { grid-template-columns: 1fr; }
}

.feature-card-v2.rich-card { 
    background: white; border-radius: 24px; overflow: hidden; display: flex; flex-direction: column;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06); text-decoration: none; color: inherit; transition: 0.3s;
    border: 1px solid #f2f2f7; height: 100%;
}
.feature-card-v2.rich-card:hover { transform: translateY(-6px); box-shadow: 0 15px 35px rgba(0,0,0,0.12); }

.card-visuals { display: flex; height: 180px; background: #f9f9fb; border-bottom: 1px solid #f2f2f7; overflow: hidden; }
.thumb-main, .thumb-sub, .thumb-full { flex: 1; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #f0f0f3; }
.thumb-sub { border-left: 1px solid #fff; }
.thumb-full { flex: 2; } /* Spans full width */

.card-visuals img { width: 100%; height: 100%; object-fit: cover; }
.card-visuals svg { width: 48px; height: 48px; opacity: 0.3; }

/* AI Specific Icon Layout */
.ai-icon-box svg { opacity: 0.6 !important; width: 80px !important; height: 80px !important; }

.feature-body { padding: 20px; flex: 1; display: flex; flex-direction: column; text-align: left; }
.card-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.feature-title { font-size: 1.1rem; margin: 0; font-weight: 800; color: #1c1c1e; text-transform: uppercase; letter-spacing: 0.5px; }
.feature-desc { font-size: 0.85rem; color: #636366; line-height: 1.5; margin-bottom: 15px; flex: 1; }

.card-badges { display: flex; gap: 4px; }
.badge-lang { font-size: 0.65rem; font-weight: 800; padding: 2px 6px; background: #f2f2f7; color: #8e8e93; border-radius: 4px; }

.card-footer-meta { margin-top: auto; padding-top: 12px; border-top: 1px dashed #eee; display: flex; justify-content: space-between; align-items: center; }
.level-list { display: flex; flex-wrap: wrap; gap: 4px; }
.badge-level { font-size: 0.6rem; font-weight: 700; padding: 2px 6px; border: 1px solid #ddd; border-radius: 4px; text-transform: uppercase; }

.rec-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

