/* PlaySonicGames.com — shared layout */
:root {
    --bg: #f4f1e7;
    --surface: #fffdf5;
    --surface2: #e7ecf3;
    --text: #17243a;
    --text2: #46556b;
    --muted: #626f80;
    --line: #bbc5cf;
    --line-dark: #64758b;
    --blue: #155ac2;
    --red: #c83240;
    --yellow: #ffd34d;
    --accent: var(--blue);
    --footer-bg: #e8e5d9;
    --radius: 3px;
    --head: "Chakra Petch", Arial, sans-serif;
    --body: "IBM Plex Sans", Arial, sans-serif;
    color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--bg);
    color: var(--text);

    font-family: var(--body);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.55;

    background-image:
        linear-gradient(
            rgba(70, 60, 40, 0.025) 1px,
            transparent 1px
        );

    background-size: 100% 4px;
}
#main-content { flex: 1; min-width: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.skip-link {
    position: fixed;
    top: 8px;
    left: 16px;
    z-index: 100;
    padding: 10px 16px;
    background: var(--surface);
    color: var(--accent);
    transform: translateY(-150%);
}
.skip-link:focus { transform: none; }

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; min-height: 58px; gap: 18px; }
.brand { display: inline-flex; align-items: center; flex-shrink: 0; gap: 9px; white-space: nowrap; }
.logo-img { width: 38px; height: 38px; flex-shrink: 0; }
.logo-text { font: 700 24px/1 var(--head); letter-spacing: -0.5px; }
.logo-text span { color: var(--accent); }
.logo-text small { display: block; margin-top: 5px; color: var(--text2); font-size: 11px; letter-spacing: 3px; text-transform: uppercase; }

/* Search */
.search {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    max-width: 360px;
    margin-left: auto;
    background: var(--bg);
    border: 1px solid var(--line-dark);
    border-radius: 5px;
    overflow: hidden;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.search input { width: 100%; min-width: 0; height: 40px; padding: 0 11px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; }
.search input::placeholder { color: var(--muted); opacity: 1; }
.search-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    height: 40px;
    padding: 0;
    border: 0;
    border-left: 1px solid var(--line);
    background: var(--surface2);
    color: var(--accent);
    cursor: pointer;
}
.search-submit:hover { background: var(--accent); color: #fff; }
.search-submit:focus-visible { outline-offset: -3px; }
.search-icon { width: 20px; height: 20px; }

/* Navigation */
.nav { display: flex; align-self: stretch; flex-shrink: 0; }
.nav a { display: flex; align-items: center; padding: 0 11px; border-bottom: 3px solid transparent; color: var(--text2); font: 700 15px/1 var(--head); }
.nav a:hover, .nav a.selected { color: var(--accent); background: var(--surface2); border-bottom-color: var(--accent); }
.btn-icon-toggle, .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    cursor: pointer;
}
.btn-icon-toggle:hover, .menu-toggle:hover { color: var(--accent); background: var(--surface2); }
.btn-icon-toggle svg { width: 20px; height: 20px; }
.theme-btn .icon-sun { display: none; }
.theme-btn .icon-moon { display: block; }
.menu-toggle { display: none; }
.main-nav-mobile { display: none; padding: 8px 0 12px; border-top: 1px solid var(--line); }
.main-nav-mobile a { padding: 11px 12px; color: var(--text2); font: 700 16px/1.2 var(--head); border-radius: var(--radius); }
.main-nav-mobile a:hover, .main-nav-mobile a.selected { color: var(--accent); background: var(--surface2); }

/* Footer */
.site-footer {
    margin-top: 32px;
    padding: 24px 0;
    border-top: 1px solid var(--line);
    background: var(--footer-bg);
    color: var(--text2);
    text-align: center;
    font-size: 14px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 22px;
    margin-bottom: 12px;
}

.footer-links a:hover {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer-copyright {
    margin-bottom: 7px;
}

.site-footer .disclaimer {
    max-width: 720px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

@media (max-width: 600px) {
    .site-footer {
        margin-top: 24px;
        padding: 20px 0;
    }

    .footer-links {
        gap: 8px 16px;
    }
}

/* Shared breadcrumb */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.breadcrumb a { color: var(--text2); }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.breadcrumb > span:last-child { color: var(--text); }

/* Dark theme — keep legacy color variables for page styles. */
body.dark {
    --bg: #111a2b;
    --surface: #182438;
    --surface2: #23344d;
    --text: #edf2f8;
    --text2: #c0ccdc;
    --muted: #a0aec2;
    --line: #3c4d65;
    --line-dark: #8092aa;
    --blue: #79b2ff;
    --red: #ff8390;
    --yellow: #ffdc72;
    --footer-bg: #152034;
    color-scheme: dark;
}
body.dark .theme-btn .icon-sun { display: block; color: var(--yellow); }
body.dark .theme-btn .icon-moon { display: none; }
body.dark .search-submit:hover { color: #111a2b; }

@media (max-width: 920px) {
    .header-inner { gap: 10px; }
    .nav { display: none; }
    .menu-toggle { display: inline-flex; }
    .search { max-width: none; }
    .main-nav-mobile.active { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
}
@media (max-width: 768px) {
    .footer-main { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
    .footer-about { grid-column: 1 / -1; }
    .footer-column p { max-width: 540px; }
    .footer-bottom { flex-direction: column; gap: 8px; }
    .footer-bottom .disclaimer { max-width: none; text-align: left; }
}
@media (max-width: 600px) {
    .container { padding: 0 12px; }
    .header-inner { flex-wrap: wrap; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
    .brand { margin-right: auto; }
    .logo-text { font-size: 23px; }
    .search { order: 5; flex-basis: 100%; margin-left: 0; }
    .search input, .search-submit { height: 42px; }
    .breadcrumb { margin-bottom: 16px; }
    .site-footer { margin-top: 24px; padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

.logo-img {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    object-fit: contain;
}

