/* ── Home page layout ── */
body:has(.sp-home) {
    background: #111827;
}
body:has(.sp-home) header {
    display: none !important;
}
body:has(.sp-home) > .container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}
body:has(.sp-home) footer {
    background: #0f172a;
    border-top: 1px solid #1f2937 !important;
}
body:has(.sp-home) footer,
body:has(.sp-home) footer a {
    color: #4b5563 !important;
}

.sp-home {
    min-height: 100vh;
    color: #e5e7eb;
    padding: 1.5rem 1rem 2rem;
    max-width: 480px;
    margin: 0 auto;
}

/* ── Logo / header ── */
.sp-logo-wrap {
    position: relative;
}

.sp-logo {
    text-align: center;
    padding: 3rem 0 2rem;
}
.sp-logo h1 {
    font-size: clamp(2rem, 8vw, 2.8rem);
    font-weight: 800;
    color: #D4AF37;
    letter-spacing: 0.05em;
    margin: 0;
}
.sp-logo p {
    color: #6b7280;
    font-size: 0.85rem;
    margin: 0.25rem 0 0;
}

.sp-auth-corner {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.25rem 0;
}

.sp-auth-corner .dropdown-menu {
    font-size: 0.85rem;
}

/* ── Error banner ── */
.sp-error {
    background: #450a0a;
    border: 1px solid #7f1d1d;
    border-radius: 8px;
    color: #fca5a5;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    text-align: center;
    font-size: 0.9rem;
}

/* ── Section label ── */
.sp-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #6b7280;
    margin-bottom: 0.6rem;
}

/* ── Join section ── */
.sp-join {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 2rem;
}
.sp-join input[type="text"] {
    display: block;
    width: 100%;
    background: #111827;
    border: 1px solid #374151;
    border-radius: 8px;
    color: #f9fafb;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.3em;
    text-align: center;
    padding: 0.65rem 1rem;
    margin-bottom: 0.75rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.sp-join input[type="text"]:focus {
    border-color: #D4AF37;
    box-shadow: 0 0 0 2px rgba(212,175,55,0.15);
}
.sp-join input[type="text"]::placeholder {
    color: #374151;
    letter-spacing: 0.1em;
    font-size: 0.85rem;
    font-weight: 400;
}

.sp-btn-primary {
    display: block;
    width: 100%;
    background: #D4AF37;
    color: #111827;
    border: none;
    border-radius: 8px;
    padding: 0.75rem;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.15s;
}
.sp-btn-primary:hover { background: #e6c84a; color: #111827; }

/* ── Game cards ── */
.sp-games {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.5rem;
}

.sp-game-card {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 12px;
    overflow: hidden;
}

.sp-game-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    cursor: pointer;
    user-select: none;
}

.sp-game-icon {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sp-game-meta { flex: 1; min-width: 0; }
.sp-game-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #f9fafb;
    margin: 0 0 0.1rem;
    line-height: 1.2;
}
.sp-game-players { font-size: 0.75rem; color: #6b7280; }

.sp-game-btns {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-shrink: 0;
}

.sp-btn-play {
    background: #D4AF37;
    color: #111827;
    border: none;
    border-radius: 6px;
    padding: 0.35rem 0.85rem;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    transition: background 0.15s;
}
.sp-btn-play:hover { background: #e6c84a; color: #111827; }

/* Per-game play button colours */
.btn-play-sketch   { background: linear-gradient(135deg, #1e3a5f, #2563eb); color: #93c5fd; }
.btn-play-sketchag { background: linear-gradient(135deg, #14532d, #16a34a); color: #86efac; }
.btn-play-cc       { background: linear-gradient(135deg, #667eea, #764ba2); color: white;   }
.btn-play-cq       { background: linear-gradient(135deg, #92400e, #78350f); color: #D4AF37; }
.btn-play-go       { background: linear-gradient(135deg, #DCB35C, #C4993D); color: #1a1a1a; }

.sp-btn-chevron {
    background: none;
    border: none;
    color: #6b7280;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, color 0.15s;
    flex-shrink: 0;
    font-size: 0.9rem;
    padding: 0;
    line-height: 1;
}
.sp-btn-chevron:hover { color: #d1d5db; }
.sp-btn-chevron.open { transform: rotate(180deg); }

.sp-chevron-img {
    filter: invert(0.5);
    pointer-events: none;
}

.sp-game-desc, .sp-game-form {
    border-top: 1px solid #374151;
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
    color: #9ca3af;
    line-height: 1.55;
    display: none;
}
.sp-game-form { color: #e5e7eb; }
.sp-game-form input[type="text"] {
    display: block;
    width: 100%;
    background: #111827;
    border: 1px solid #374151;
    border-radius: 6px;
    color: #f9fafb;
    padding: 0.5rem 0.75rem;
    font-size: 16px;
    margin-bottom: 0.5rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.sp-game-form input[type="text"]:focus { border-color: #D4AF37; }
.sp-game-form input[type="text"]::placeholder { color: #4b5563; }
.sp-game-form button[type="submit"] {
    width: 100%;
    background: #D4AF37;
    color: #111827;
    border: none;
    border-radius: 6px;
    padding: 0.55rem;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s;
}
.sp-game-form button[type="submit"]:hover { background: #e6c84a; }

/* ── Icon accent colours ── */
.icon-sketch   { background: linear-gradient(135deg, #1e3a5f, #2563eb); color: #93c5fd; }
.icon-sketchag { background: linear-gradient(135deg, #14532d, #16a34a); color: #86efac; }
.icon-cc       { background: linear-gradient(135deg, #4c1d95, #6d28d9); color: #c4b5fd; }
.icon-sketchcep { background: linear-gradient(135deg, #7c2d12, #ea580c); color: #fdba74; }
.icon-ts       { background: linear-gradient(135deg, #0e4f5c, #0891b2); color: #67e8f9; }
.icon-cq       { background: linear-gradient(135deg, #78350f, #b45309); color: #D4AF37; }
.icon-go       { background: #2d1f0a; color: #C4993D; }

.icon-cq-img {
    filter: invert(0.8) sepia(1) saturate(3) hue-rotate(5deg);
    pointer-events: none;
}

.icon-sketchcep-img {
    filter: invert(0.8) sepia(1) saturate(3) hue-rotate(190deg);
    pointer-events: none;
}

/* ── PWA install ── */
.sp-install {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    display: none;
}
.sp-install button {
    background: none;
    border: 1px solid #4b5563;
    border-radius: 8px;
    color: #9ca3af;
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    cursor: pointer;
    width: 100%;
}
.sp-install button:hover { border-color: #9ca3af; color: #e5e7eb; }
