/* Shared arcade palette. Game logic still owns the colours inside canvas/SVG fields. */
body.arcade-site {
    --site-bg: #101923;
    --site-panel: #182632;
    --site-panel-raised: #213440;
    --site-border: #40515d;
    --site-ink: #f4f7fa;
    --site-muted: #becdd7;
    --site-accent: #c2fa6b;
    background: radial-gradient(ellipse at 80% 0, #183f36 0, transparent 45%), var(--site-bg);
    color: var(--site-ink);
    background-attachment: scroll;
    font-size: 16px;
    line-height: 1.5;
}
.arcade-site > header { background: #111a21; border-bottom: 1px solid #2c4249; }
.arcade-site > header .page-container { background: transparent; }
.arcade-site > header a { color: #e5edf3; }
.arcade-site > header .active { background: #2d482d; color: #d7ff9e; }
.arcade-site #leaf { display: none; }
.arcade-site #logo svg { height: 48px; max-width: 100%; }
.arcade-site > .page-container.justify-between { padding: 16px 0; }
.arcade-site .page-container { box-sizing: border-box; max-width: 1200px; }
.arcade-site .content:not(.games-content), .arcade-site .puzzle-content, .arcade-site .puzzles,
.arcade-site .privacy, .arcade-site .contacts { background: var(--site-panel); color: var(--site-ink); border-radius: 16px; }
.arcade-site .content:not(.games-content):not(.anagrams-play):not(.hangman-content) { padding: 24px; }
.arcade-site .content > section { background-color: transparent; }
.arcade-site h1, .arcade-site h2, .arcade-site h3, .arcade-site .lets-play { color: var(--site-ink); }
.arcade-site h1 { line-height: 1.2; }
.arcade-site h2, .arcade-site h3 { line-height: 1.3; text-align: left}
.arcade-site a { color: #c2fa6b; }
.arcade-site a:hover { text-decoration-color: currentColor; }
.arcade-site a:focus-visible, .arcade-site button:focus-visible,
.arcade-site input:focus-visible, .arcade-site summary:focus-visible,
.arcade-site [contenteditable]:focus-visible { outline: 3px solid var(--site-accent); outline-offset: 3px; }
.arcade-site .dropdown-menu { background: #213440; border: 1px solid #536573; border-radius: 10px; box-shadow: 0 12px 24px #0006; }
.arcade-site .dropdown-menu a { color: #f4f7fa; }
.arcade-site .dropdown-menu a:hover { background: #314c3e; }
.arcade-site footer, .arcade-site footer a { color: #becdd7; }
.arcade-site footer { padding: 24px 0; font-size: 13px; }
.arcade-site .mobile-title, .arcade-site .anagrams-hub .mobile-title { padding: 22px; background: linear-gradient(115deg, #1c302e, #15252c); border: 1px solid #3c6355; border-radius: 14px; color: #eef5f7; }
.arcade-site .mobile-title h1 { color: #f4f7fa; }
.arcade-site .first-page-p1 { color: var(--site-muted); line-height: 1.7; }
.arcade-site .levels-group { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; padding: 16px 0; }
.arcade-site .levels-group > a { margin: 0; border: 2px solid #dce7ed; border-radius: 12px; background: #f5f8fa; color: #162332; box-shadow: 0 5px 0 #080f18; transform-origin: center; transition: transform .18s ease, border-color .18s ease; }
.arcade-site .levels-group > a:hover { border-color: #c2fa6b; }
.arcade-site .levels-group .label { box-shadow: none; }
.arcade-site .anagrams-levels > a { width: calc((100% - 32px) / 3); }
.arcade-site .choose a, .arcade-site .greenbutton, .arcade-site .default-button,
.arcade-site .choose-cta a { box-sizing: border-box; border: 1px solid #a8d958; border-radius: 8px; background: #c2fa6b; color: #172a19; box-shadow: 0 3px 0 #678e37; text-shadow: none; font-weight: bold; }
.arcade-site .choose a:hover, .arcade-site .greenbutton:hover, .arcade-site .choose-cta a:hover { background: #d5ff98; color: #172a19; }
.arcade-site .greybutton { border: 1px solid #647782; border-radius: 8px; background: #304554; color: #fff; box-shadow: none; text-shadow: none; }
.arcade-site .greybutton:hover { background: #425f71; }
.arcade-site button:disabled { cursor: default; }
.arcade-site .benefit-list, .arcade-site .anagrams-home-cta, .arcade-site .learn-pack,
.arcade-site .content > div[style*="background"], .arcade-site .ribbon { background: var(--site-panel-raised) !important; color: #d5e0e8; border-radius: 12px; }
.arcade-site .list-content, .arcade-site .anagrams-home-title, .arcade-site .anagrams-home-text { color: inherit; }
.arcade-site .anagrams-home-cta { margin: 20px 0; border: 1px solid var(--site-border); box-shadow: none; }
.arcade-site .anagrams-home-art > span, .arcade-site .anagrams-preview > span { background: #c7b9ff; color: #30234f; border-color: #b0a0ed; box-shadow: 0 4px 0 #766491; }
.arcade-site .list-h2 { color: #fff; }
.arcade-site .menu-puzzle-list a, .arcade-site .menu-puzzle-list .front { border-radius: 10px; border-color: #b1c7b8; background: #f5f8fa; color: #162332; }
.arcade-site .menu-puzzle-list a:hover { border-color: #c2fa6b; }
.arcade-site #levels .active, .arcade-site .puzzle-top-menu { background: #213440; color: #f4f7fa; border-color: #40515d; }
.arcade-site .puzzle-top-menu { border-radius: 10px; }
.arcade-site .puzzle-top-menu .blue-a { color: #d0ecb2; }
.arcade-site.gameplay-page #top-menu.gameplay-menu {
    --menu-ink: #f4f7fa;
    --menu-surface: #182632;
    --menu-border: #40515d;
    --tools-accent: #35513e;
    padding: 8px 12px;
    border: 1px solid #40515d;
    border-radius: 12px;
}
.arcade-site.gameplay-page #top-menu .game-menu-button { color: #edf5fa; }
.arcade-site.gameplay-page #top-menu .game-menu-button:hover { background: #304b3c; }
.arcade-site.gameplay-page #top-menu .game-menu-title a { color: #d2fa9f; }
.arcade-site.gameplay-page #top-menu .game-menu-tools { background: #182632; border-color: #40515d; }
.arcade-site.gameplay-page #top-menu #top-menu_inp { color: #fff; background: #253b49; border-color: #536573; }
.arcade-site .anagrams-game, .arcade-site .anagrams-solved,
.arcade-site .hangman-card, .arcade-site .hangman-topic { background: #182632; color: #f4f7fa; border: 1px solid #40515d; border-radius: 14px; box-shadow: none; }
.arcade-site .anagrams-hint-card { background: #253b3c; border: 1px solid #466459; border-radius: 12px; }
.arcade-site .anagrams-hint, .arcade-site .anagrams-hint-label { color: #e3eedd; }
.arcade-site .anagrams-progress { color: #c2fa6b; }
.arcade-site .anagrams-progress-track { background: #304554; }
.arcade-site #anagrams-progress-fill { background: #c2fa6b; }
.arcade-site .anagrams-tile, .arcade-site .anagrams-slot { border-radius: 9px; }
.arcade-site .anagrams-solved, .arcade-site .anagrams-solved li,
.arcade-site .glossary, .arcade-site .glossary a, .arcade-site .glossary li { color: #e4eef4; }
.arcade-site .anagrams-solved h2, .arcade-site .anagrams-solved h3 { color: #c2fa6b; }
.arcade-site .hangman-home .hangman-home-start { background: #213440; color: #edf5fa; border-color: #40515d; }
.arcade-site .hangman-topic-count { color: #becdd7; }
.arcade-site .hangman-home .hangman-home-actions a { color: #c2fa6b; }
.arcade-site .hangman-key, .arcade-site .hangman-topics button, .arcade-site .hangman-game-list a { border-color: #536573; background: #253b49; color: #eef5fa; }
.arcade-site .hangman-key:hover:not(:disabled), .arcade-site .hangman-game-list a:hover { background: #3c5a43; color: #fff; }
.arcade-site .hangman-key.is-correct, .arcade-site .hangman-topics button[aria-pressed="true"], .arcade-site .hangman-game-list a.is-solved { background: #c2fa6b; color: #172a19; border-color: #c2fa6b; }
.arcade-site .hangman-key.is-wrong { background: #422f38; color: #d1adb8; border-color: #77535e; }
.arcade-site .hangman-letter { color: #fff; border-color: #a8d958; }

.arcade-site .privacy-doc, .arcade-site .privacy-body, .arcade-site .contacts-form,
.arcade-site .privacy-contact { background: #182632; color: #dde8ed; border-radius: 14px; }
.arcade-site .privacy-hero { background: linear-gradient(115deg, #1c302e, #15252c); border-color: #3c6355; }
.arcade-site .privacy-lead, .arcade-site .privacy-body p, .arcade-site .privacy-body li { color: #d4e0e6; }
.arcade-site .privacy-toc { background: #213440; border-color: #40515d; }
.arcade-site .privacy-toc a, .arcade-site .privacy-body a { color: #c2fa6b; }
.arcade-site input:not([type="checkbox"]):not([type="radio"]), .arcade-site textarea,
.arcade-site select { border-radius: 7px; border: 1px solid #647782; background: #f5f8fa; color: #162332; }
.arcade-site .translate-src, .arcade-site .transate-dest, .arcade-site .translate-pair.title,
.arcade-site .lang-side { background: #213440; color: #edf5fa; border-color: #536573; }
.arcade-site [contenteditable="true"] { background: #f5f8fa; color: #162332; border-radius: 6px; }
.arcade-site table { color: inherit; }
.arcade-site tr:nth-child(even) { background: #ffffff06; }
.arcade-site .owindow, .arcade-site .modal, .arcade-site .cookie-popup { background: #f5f8fa; color: #162332; border: 1px solid #ccd7de; border-radius: 14px; box-shadow: 0 16px 48px #0005; }
.arcade-site .owindow h2, .arcade-site .owindow h3, .arcade-site .modal h2,
.arcade-site .cookie-popup_heading, .arcade-site .cookie-popup_text { color: #162332; }
.arcade-site .owindow a:not(.greenbutton), .arcade-site .modal a { color: #22583c; }
/* The catalogue cards deliberately remain light, distinct from the site chrome. */
.arcade-site .games-card, .arcade-site .games-card h3 { color: #162332; }
.arcade-site .games-card-action { color: #fff; }
.arcade-site .games-card:hover .games-card-action { color: var(--accent-ink); }
.arcade-site .games-hero-button { color: #15230f; }
.arcade-site [hidden] { display: none !important; }
@media (hover: hover) and (pointer: fine) {
    .arcade-site .levels-group > a:hover { transform: scale(1.03); z-index: 1; }
}
@media (max-width: 600px) {
    .arcade-site .content:not(.games-content):not(.anagrams-play):not(.hangman-content) { padding: 16px; }
    .arcade-site .levels-group { gap: 10px; }
    .arcade-site .anagrams-levels > a { width: 100%; max-width: 360px; }
    .arcade-site .mobile-title { padding: 18px 14px; }
    .arcade-site .page-container { width: 94%; }
    .arcade-site footer { font-size: 12px; }

}
@media (prefers-reduced-motion: reduce) {
    .arcade-site .levels-group > a { transition: none; }
    .arcade-site .levels-group > a:hover { transform: none; }
}
@media print {
    body.arcade-site, .arcade-site .content:not(.games-content), .arcade-site .privacy,
    .arcade-site .puzzles { background: #fff; color: #111; }
    .arcade-site h1, .arcade-site h2, .arcade-site h3, .arcade-site a { color: #111; }
}
/* Landing pages retain pageName=first for saved-game handling, without the old light panel. */
body.arcade-site.wordsearch-home .games-content { width: min(1200px, 92%); padding: 16px 0 32px; border: 0; background: transparent; color: #f4f7fa; }
.arcade-site.wordsearch-home .wordsearch-difficulty-copy h3 { text-align: start; }
/* Keep the shared calls to action and secondary text legible in legacy game templates. */
.arcade-site .levels-group > a { box-sizing: border-box; }
.arcade-site .anagrams-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.arcade-site .anagrams-levels > a { width: 100%; }
.arcade-site .hangman-home .hangman-home-actions .choose-cta a { color: #172a19; }

.arcade-site .privacy-toc a { background: #253b49; border-color: #536573; color: #d2fa9f; }
.arcade-site .privacy-toc a:hover { background: #35513e; }
.arcade-site.dark-mode .greenbutton { background: #c2fa6b; color: #172a19; border-color: #a8d958; }
.arcade-site .anagrams-progress-panel .anagrams-progress { color: #c2fa6b; }
.wordsearch-home:lang(hi) svg text { font-family: 'Noto Sans Devanagari', sans-serif; }
@media (max-width: 600px) { .arcade-site .anagrams-levels { grid-template-columns: minmax(0, 1fr); } }
.arcade-site footer.page-container { background: transparent; border-top: 1px solid #30434e; }
.arcade-site input.default-button[type="submit"] { background: #c2fa6b; color: #172a19; border-color: #a8d958; }
.arcade-site input.default-button[type="submit"]:disabled { opacity: .55; box-shadow: none; }
.arcade-site.gameplay-page #top-menu #title { background: transparent; border: 0; }
.arcade-site #rules-title, .arcade-site #dict-title, .arcade-site #scores-title { background: #213440; border-color: #40515d; color: #f4f7fa; border-radius: 8px; }
.arcade-site .first-page-p1 b, .arcade-site .first-page-p1 strong { color: #d2fa9f; }
.arcade-site.contacts #top-menu { display: none; }
/* Do not let legacy .first .content rules alter the word-search reference layout. */
body.wordsearch-home .wordsearch-home { line-height: normal; }
body.wordsearch-home .wordsearch-home p { padding: 0; }
body.wordsearch-home .wordsearch-home .games-intro { line-height: 1.5; }
body.wordsearch-home .wordsearch-home .games-hero-note { line-height: 1.6; }
body.wordsearch-home .games-breadcrumbs, body.wordsearch-home .games-brand { line-height: normal; }
body.wordsearch-home .games-brand { color: #fff; }
body.wordsearch-home .games-breadcrumbs a { color: #cfdfeb; }
body.wordsearch-home .games-section-heading h2 { margin: 6px 0 0; }
/* A single, stable language row across game hubs, catalogs and information pages. */
.arcade-site > header > .page-container.language-panel {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 0;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 12px;
}
.arcade-site .language-panel > a,
.arcade-site .language-panel > span.active {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 44px;
    margin: 0;
    padding: 8px 9px;
    font-size: 14px;
    line-height: 20px;
    white-space: nowrap;
}
.arcade-site .language-panel #home-button { width: 40px; height: 44px; margin: 0 4px 0 0; padding: 8px; }
.arcade-site .language-panel > ul.language-overflow { position: relative; display: none; flex: 0 0 44px; margin: 0 0 0 auto; padding: 0; }
.arcade-site .language-panel ul, .arcade-site .language-panel li { list-style: none; }
.arcade-site .language-panel .language-overflow > li { margin: 0; padding: 0; }
.arcade-site .language-panel .dropdown-img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: #e5edf3;
}
.arcade-site .language-panel .dropdown-img::after { content: ''; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); }
.arcade-site .language-panel .dropdown-img:hover { background: #263d36; }
.arcade-site .language-panel .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 170px;
    max-width: calc(100vw - 24px);
    max-height: 70vh;
    overflow-y: auto;
    margin: 0;
    padding: 6px;
    z-index: 30;
}
.arcade-site .language-panel #dropdown-menu li { margin: 0; padding: 0; }
.arcade-site .language-panel #dropdown-menu a { display: flex; align-items: center; min-height: 44px; box-sizing: border-box; margin: 0; padding: 8px 14px; font-size: 14px; line-height: 20px; border-radius: 6px; white-space: nowrap; }
@media (max-width: 1100px) {
    .arcade-site .language-panel > .hide_on_mob { display: none; }
    .arcade-site .language-panel > ul.language-overflow { display: block; }
}
@media (max-width: 640px) {
    .arcade-site > header > .page-container.language-panel { padding: 0 6px; }
    .arcade-site .language-panel > a, .arcade-site .language-panel > span.active { padding: 8px 6px; font-size: 13px; }
    .arcade-site .language-panel #home-button { display: none; }
}

/* Game hubs share the language row and breadcrumb trail. */
.arcade-site > header > .language-panel.language-panel--wide { max-width: none; }
.arcade-site .language-panel--wide > a,
.arcade-site .language-panel--wide > span.active { flex: 1 1 auto; }
.arcade-site .games-breadcrumbs { margin-bottom: 14px; color: #aebcc9; font-size: 13px; line-height: normal; }
.arcade-site .games-breadcrumbs a { color: #cfdfeb; text-decoration: none; }
.arcade-site .games-breadcrumbs a:hover { text-decoration: underline; }
.arcade-site .game-hub-breadcrumbs { width: min(1200px, 92%); margin: 16px auto 14px; padding: 0; }
.arcade-site .content.anagrams-hub { margin-top: 0; }
.arcade-site .games-content.games-directory { padding-top: 0; }

/* A saved game is offered in the page flow, without interrupting selection. */
.resume-game[hidden] { display: none !important; }
.resume-game { margin: 20px 0 24px; }
body.arcade-site .resume-game-link {
    display: flex; align-items: center; justify-content: center; gap: 16px;
    box-sizing: border-box; width: 100%; min-height: 64px; padding: 18px 24px;
    border: 2px solid #c2fa6b; border-radius: 12px; background: #c2fa6b;
    color: #172a19; font-size: 20px; font-weight: 700; line-height: 1.45;
    text-align: center; text-decoration: none; overflow-wrap: anywhere;
}
body.arcade-site .resume-game-link:hover { background: #d5ff96; border-color: #d5ff96; color: #172a19; }
body.arcade-site .resume-game-link:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.resume-game-link > [aria-hidden] { flex-shrink: 0; }
@media (max-width: 600px) {
    body.arcade-site .resume-game-link { padding: 16px; font-size: 17px; }
}
