/* =====================================================================
   style.css — Shared base styles: theme tokens, resets, typography,
   buttons, landing/entry pages. Loaded on every page.
   ===================================================================== */

:root {
    --emerald-900: #020f0a;
    --emerald-800: #052417;
    --emerald-700: #093724;
    --emerald-600: #0f4f34;
    --emerald-500: #176845;
    --felt-radial: radial-gradient(ellipse at 50% 45%, #156641 0%, #0c3e27 45%, #051a11 85%, #020b07 100%);

    --gold-300: #fcedab;
    --gold-400: #f3d98b;
    --gold-500: #e8c25f;
    --gold-600: #c9a13f;

    --ivory: #fbf8f0;
    --ivory-dim: #cfc7b3;

    --card-white: #ffffff;
    --card-red: #d01d33;
    --card-black: #161616;

    --danger: #e0455a;
    --danger-dark: #b82a3d;

    --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;

    --font-display: 'Georgia', 'Iowan Old Style', serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    color-scheme: dark;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

[hidden] {
    display: none !important;
}

html, body {
    height: 100%;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

body {
    font-family: var(--font-body);
    background: var(--felt-radial);
    color: var(--ivory);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3 {
    font-family: var(--font-display);
    color: var(--gold-400);
    margin: 0 0 8px;
    letter-spacing: 0.02em;
}

p { margin: 0 0 12px; color: var(--ivory-dim); line-height: 1.5; }
a { color: var(--gold-400); }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 15px;
    padding: 12px 22px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.1s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.15s ease, filter 0.15s ease;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}
.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary {
    background: linear-gradient(180deg, var(--gold-400), var(--gold-600));
    color: #1a1005;
    box-shadow: 0 4px 14px rgba(232, 194, 95, 0.35);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }

.btn-secondary {
    background: rgba(246, 241, 228, 0.08);
    color: var(--ivory);
    border-color: rgba(246, 241, 228, 0.25);
    backdrop-filter: blur(4px);
}
.btn-secondary:hover:not(:disabled) { background: rgba(246, 241, 228, 0.18); border-color: var(--gold-400); }

.btn-danger {
    background: rgba(224, 69, 90, 0.18);
    color: #ffadb8;
    border-color: rgba(224, 69, 90, 0.45);
}
.btn-danger:hover:not(:disabled) { background: rgba(224, 69, 90, 0.3); border-color: #ffadb8; }

.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-block { width: 100%; }

/* --- Landing page --- */
.page-landing {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    min-height: 100vh;
}
.landing-wrap { width: 100%; max-width: 440px; }
.landing-card {
    background: rgba(5, 26, 18, 0.82);
    border: 1px solid rgba(232, 194, 95, 0.3);
    border-radius: var(--radius-lg);
    padding: 38px 26px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(8px);
}
.landing-suits { font-size: 46px; color: var(--gold-400); margin-bottom: 6px; }
.landing-card h1 { font-size: 38px; }
.landing-tagline { font-size: 15px; margin-bottom: 20px; }
.landing-actions { display: flex; flex-direction: column; gap: 12px; margin: 20px 0; }
.landing-rules {
    text-align: left;
    color: var(--ivory-dim);
    font-size: 13px;
    padding-left: 20px;
    margin: 0;
    line-height: 1.6;
}
.landing-rules li { margin-bottom: 4px; }

/* --- Entry pages (create/join room) --- */
.page-entry {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    min-height: 100vh;
}
.entry-wrap { width: 100%; max-width: 420px; }
.entry-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 14px;
    font-size: 14px;
    color: var(--ivory-dim);
    text-decoration: none;
    transition: color 0.15s ease;
}
.entry-back:hover { color: var(--gold-400); }
.entry-card {
    background: rgba(5, 26, 18, 0.82);
    border: 1px solid rgba(232, 194, 95, 0.3);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(8px);
}
.entry-sub { font-size: 14px; }

form label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--gold-400);
    margin: 16px 0 6px;
    letter-spacing: 0.02em;
}
form input[type="text"],
form input[type="number"] {
    width: 100%;
    padding: 13px 14px;
    font-size: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(246, 241, 228, 0.2);
    background: rgba(2, 14, 10, 0.75);
    color: var(--ivory);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
form input:focus {
    border-color: var(--gold-400);
    box-shadow: 0 0 10px rgba(232, 194, 95, 0.3);
}
.input-room-code { letter-spacing: 0.25em; text-transform: uppercase; font-weight: 800; text-align: center; }

form button[type="submit"] { margin-top: 24px; }

.form-error {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: rgba(224, 69, 90, 0.18);
    border: 1px solid rgba(224, 69, 90, 0.45);
    color: #ffadb8;
    font-size: 13px;
}

/* --- Toast --- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%) translateY(20px);
    background: rgba(3, 16, 11, 0.95);
    border: 1px solid rgba(232, 194, 95, 0.5);
    color: var(--ivory);
    padding: 11px 22px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    z-index: 9999;
    max-width: 90vw;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.toast--show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast--fadeout {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
}

/* --- Connection status --- */
.connection-status {
    font-size: 11px;
    text-align: center;
    padding: 2px 0;
    margin: 0;
    font-weight: 600;
}
.connection-status--ok { color: #8fd6a8; }
.connection-status--warn { color: var(--gold-400); }
.connection-status--error { color: #ffadb8; }

@media (max-width: 480px) {
    .landing-card, .entry-card { padding: 26px 18px; }
    .landing-card h1 { font-size: 30px; }
    .landing-suits { font-size: 38px; }
}
