/* Styles for the server-rendered pages (templates/site/*) and the static sections inside spa.html.
   The design tokens below mirror frontend/src/theme.css — keep the two in sync. */
@import url('https://fonts.googleapis.com/css2?family=Bungee&family=Nunito:wght@400;600;700;800&display=swap');

:root {
    --gts-pink: #f25ca2;
    --gts-pink-deep: #c93a80;
    --gts-cyan: #35b6e8;
    --gts-blue: #1b75bc;
    --gts-red: #ef3b4a;

    --bg: #16132a;
    --surface: #2a2640;
    --surface-2: #403a62;
    --surface-raised: var(--surface-2);
    --outline: #0e0b18;
    --text: #f7f5fc;
    --text-muted: #bfb9d8;

    --accent: var(--gts-pink);
    --accent-hover: var(--gts-pink-deep);
    --info: var(--gts-cyan);
    --success: #3edc97;
    --warning: #ffc53d;
    --danger: var(--gts-red);
    --on-accent: var(--outline);

    --font-display: 'Bungee', cursive;
    --font-body: 'Nunito', system-ui, sans-serif;
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-md: 1rem;
    --text-lg: 1.25rem;
    --text-xl: 2rem;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-pill: 999px;
    --border-sticker: 3px solid var(--outline);
    --shadow-sticker: 4px 4px 0 var(--outline);
    --shadow-sticker-sm: 2px 2px 0 var(--outline);

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 16px;
    --space-4: 24px;
    --space-5: 40px;

    --transition: 120ms ease;
}

@media (max-width: 700px) {
    :root {
        --text-xl: 1.5rem;
        --text-lg: 1.05rem;
        --space-3: 12px;
        --space-4: 16px;
        --space-5: 24px;
    }
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
}

/* static pages only: sticky footer. spa.html keeps its own layout. */
.gts-site-body {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* ---------- header / nav (static pages) ---------- */
.gts-site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    flex-wrap: wrap;
}

.gts-site-nav-brand img {
    height: 34px;
    display: block;
}

.gts-site-nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.gts-site-nav-links a {
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
    font-size: var(--text-md);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
}

.gts-site-nav-links a:hover {
    color: var(--outline);
    background: var(--info);
}

.gts-site-nav-links a.gts-site-nav-primary {
    background: var(--accent);
    color: var(--on-accent);
    border: 2px solid var(--outline);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-sticker-sm);
}

.gts-site-nav-links a.gts-site-nav-primary:hover {
    background: var(--accent-hover);
}

/* ---------- page body ---------- */
.gts-site-main {
    flex: 1;
    width: 100%;
    max-width: 880px;
    margin-inline: auto;
    padding: var(--space-4) var(--space-3) var(--space-5);
}

.gts-site-title {
    font-family: var(--font-display);
    text-transform: uppercase;
    font-size: clamp(1.6rem, 5vw, 2.4rem);
    line-height: 1.1;
    margin: 0 0 var(--space-2);
    color: var(--accent);
    text-shadow: 3px 3px 0 var(--outline);
}

.gts-site-lede {
    color: var(--text-muted);
    font-size: var(--text-lg);
    line-height: 1.5;
    margin: 0 0 var(--space-4);
}

.gts-site-prose h2 {
    font-family: var(--font-display);
    text-transform: uppercase;
    font-size: var(--text-lg);
    margin: var(--space-4) 0 var(--space-2);
    color: var(--info);
}

.gts-site-prose h3 {
    font-size: var(--text-md);
    font-weight: 800;
    margin: var(--space-3) 0 var(--space-1);
}

.gts-site-prose p,
.gts-site-prose li {
    line-height: 1.6;
}

.gts-site-prose p {
    margin: 0 0 var(--space-3);
}

.gts-site-prose ul,
.gts-site-prose ol {
    margin: 0 0 var(--space-3);
    padding-left: 1.4em;
}

.gts-site-prose a {
    color: var(--info);
    font-weight: 700;
}

.gts-site-prose a:hover {
    color: var(--accent);
}

.gts-site-prose strong {
    color: var(--warning);
}

.gts-site-updated {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

/* sticker cards */
.gts-site-card {
    background: var(--surface);
    border: var(--border-sticker);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sticker);
    padding: var(--space-3);
}

.gts-site-card h2,
.gts-site-card h3 {
    margin-top: 0;
}

.gts-site-grid {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin: var(--space-3) 0;
}

/* step list on how-to-play / landing */
.gts-site-steps {
    list-style: none;
    padding: 0;
    margin: var(--space-3) 0;
    display: grid;
    gap: var(--space-2);
    counter-reset: step;
}

.gts-site-steps li {
    counter-increment: step;
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
    background: var(--surface);
    border: var(--border-sticker);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sticker-sm);
    padding: var(--space-2) var(--space-3);
}

.gts-site-steps li::before {
    content: counter(step);
    flex: none;
    width: 2em;
    height: 2em;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    background: var(--accent);
    color: var(--on-accent);
    border: 2px solid var(--outline);
    border-radius: var(--radius-pill);
}

/* definition table (scoring, faq) */
.gts-site-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0 0 var(--space-3);
    border: var(--border-sticker);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface);
}

.gts-site-table th,
.gts-site-table td {
    text-align: left;
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--outline);
}

.gts-site-table th {
    background: var(--surface-raised);
    font-weight: 800;
}

.gts-site-table tr:last-child td {
    border-bottom: none;
}

/* faq */
.gts-site-faq details {
    background: var(--surface);
    border: var(--border-sticker);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sticker-sm);
    margin-bottom: var(--space-2);
    padding: 0 var(--space-3);
}

.gts-site-faq summary {
    cursor: pointer;
    font-weight: 800;
    padding: var(--space-2) 0;
    list-style: none;
}

.gts-site-faq summary::-webkit-details-marker {
    display: none;
}

.gts-site-faq summary::before {
    content: '▸ ';
    color: var(--accent);
}

.gts-site-faq details[open] summary::before {
    content: '▾ ';
}

.gts-site-faq details p {
    margin: 0 0 var(--space-3);
}

/* themes */
.gts-site-theme {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
}

.gts-site-theme-icon {
    flex: none;
    width: 56px;
    height: 56px;
    object-fit: cover;
    border: 2px solid var(--outline);
    border-radius: var(--radius-sm);
    background: var(--surface-raised);
}

.gts-site-theme h3 {
    margin: 0 0 var(--space-1);
    font-size: var(--text-md);
}

.gts-site-theme p {
    margin: 0 0 var(--space-1);
    color: var(--text-muted);
    line-height: 1.5;
}

.gts-site-badge {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: 800;
    padding: 0 var(--space-2);
    border-radius: var(--radius-pill);
    background: var(--surface-raised);
    border: 2px solid var(--outline);
    color: var(--text);
}

/* buttons used by static pages */
.gts-site-btn {
    display: inline-block;
    font-family: var(--font-body);
    font-weight: 800;
    text-decoration: none;
    border: var(--border-sticker);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-sticker-sm);
    background: var(--surface-raised);
    color: var(--text);
    padding: var(--space-2) var(--space-4);
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.gts-site-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 var(--outline);
}

.gts-site-prose a.gts-site-btn {
    color: var(--text);
}

.gts-site-btn--primary,
.gts-site-prose a.gts-site-btn--primary {
    background: var(--accent);
    color: var(--on-accent);
}

.gts-site-btn--primary:hover {
    background: var(--accent-hover);
}

.gts-site-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: var(--space-3) 0;
}

/* ---------- landing page section (rendered inside spa.html for the index view) ---------- */
.gts-index-seo {
    width: 100%;
    max-width: 880px;
    margin-inline: auto;
    padding: var(--space-4) var(--space-3) var(--space-5);
}

.gts-index-seo h2 {
    font-family: var(--font-display);
    text-transform: uppercase;
    font-size: var(--text-lg);
    margin: 0 0 var(--space-2);
    color: var(--info);
}

.gts-index-seo p {
    line-height: 1.6;
    margin: 0 0 var(--space-3);
}

.gts-index-seo a {
    color: var(--info);
    font-weight: 700;
}

.gts-index-seo .gts-site-card p:last-child {
    margin-bottom: 0;
}

/* ---------- footer (shared by spa.html and static pages) ---------- */
.gts-site-footer {
    border-top: var(--border-sticker);
    background: var(--surface);
    padding: var(--space-3);
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.gts-site-footer-inner {
    max-width: 880px;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.gts-site-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.gts-site-footer a {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}

.gts-site-footer a:hover {
    color: var(--accent);
}

.gts-site-footer-note {
    margin: 0;
    font-size: var(--text-xs);
}
