/* ============================================================
   CRASH Card Game - Stylesheet
   ============================================================ */

:root {
    --card-width: 80px;
    --card-height: 112px;
    --card-sm-width: 60px;
    --card-sm-height: 84px;
    --card-radius: 7px;
    --table-bg: #1a4d2e;
    --table-felt: #246b3a;
    --panel-bg: rgba(0, 0, 0, 0.35);
    --panel-border: rgba(255, 255, 255, 0.12);
    --gold: #c9a959;
    --gold-light: #e0c878;
    --text-primary: #eaeaea;
    --text-secondary: #b0b0b0;
    --btn-primary: #2a7de1;
    --btn-primary-hover: #3a8df1;
    --btn-danger: #d9534f;
    --btn-danger-hover: #e96460;
    --btn-default: #4a5568;
    --btn-default-hover: #5a6578;
    --success: #4caf50;
    --error: #ef5350;
    --warning: #ff9800;
    --card-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0d2818 0%, var(--table-bg) 40%, #0d3320 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   HEADER
   ============================================================ */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 2px solid var(--gold);
    margin-bottom: 8px;
}

header h1 {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 6px;
    color: var(--gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.site-title {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 6px;
    color: var(--gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.header-right {
    display: flex;
    gap: 8px;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
    background: var(--btn-default);
    user-select: none;
}

.btn:hover {
    background: var(--btn-default-hover);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--btn-primary);
}

.btn-primary:hover:not(:disabled) {
    background: var(--btn-primary-hover);
}

.btn-danger {
    background: var(--btn-danger);
}

.btn-danger:hover:not(:disabled) {
    background: var(--btn-danger-hover);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 12px 32px;
    font-size: 1.1rem;
}

/* ============================================================
   GAME INFO BAR
   ============================================================ */

#game-info-bar {
    display: flex;
    gap: 20px;
    padding: 8px 16px;
    background: var(--panel-bg);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    flex-wrap: wrap;
}

#game-info-bar span {
    white-space: nowrap;
}

/* ============================================================
   SCOREBOARD
   ============================================================ */

#scoreboard {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.score-item {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.score-item.is-dealer {
    border-color: var(--gold);
    box-shadow: 0 0 8px rgba(201, 169, 89, 0.3);
}

.score-item .score-name {
    font-weight: 600;
}

.score-item .score-badge {
    font-size: 0.65rem;
    color: var(--gold);
    margin-left: 6px;
    font-weight: 400;
}

.score-item .score-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold-light);
    min-width: 30px;
    text-align: right;
}

/* ============================================================
   SCREENS
   ============================================================ */

.screen {
    display: none;
}

.screen.active {
    display: block;
}

main {
    flex: 1;
}

/* ============================================================
   WELCOME SCREEN
   ============================================================ */

.welcome-box {
    max-width: 600px;
    margin: 40px auto;
    text-align: center;
    padding: 40px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
}

.welcome-box h1 {
    font-size: 1.8rem;
    color: var(--gold);
    margin-bottom: 20px;
}

.instructions {
    text-align: left;
    margin-bottom: 30px;
}

.instructions p {
    margin-bottom: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.instructions ul {
    list-style: none;
    padding: 0;
}

.instructions li {
    padding: 6px 0 6px 20px;
    position: relative;
    color: var(--text-secondary);
    line-height: 1.5;
}

.instructions li::before {
    content: "♠";
    position: absolute;
    left: 0;
    color: var(--gold);
}

/* ============================================================
   SORTING SCREEN
   ============================================================ */

#hand-slots-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.hand-slot {
    background: var(--panel-bg);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 8px;
    min-height: 150px;
    transition: all 0.2s ease;
}

.hand-slot.drag-over {
    border-color: var(--gold);
    background: rgba(201, 169, 89, 0.1);
}

.hand-slot.valid-hand {
    border-color: var(--success);
    border-style: solid;
}

.hand-slot.invalid-hand {
    border-color: var(--error);
    border-style: solid;
}

.slot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0 4px;
}

.slot-validation {
    font-size: 0.75rem;
    font-weight: 400;
}

.slot-validation.valid {
    color: var(--success);
}

.slot-validation.invalid {
    color: var(--error);
}

.slot-cards {
    display: flex;
    gap: 6px;
    min-height: 112px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    padding: 4px;
}

#spare-slot {
    background: var(--panel-bg);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 12px;
    min-height: 80px;
}

#spare-slot.drag-over {
    border-color: var(--gold);
    background: rgba(201, 169, 89, 0.1);
}

#spare-cards {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    min-height: 50px;
    padding: 4px;
}

#dealt-area {
    background: rgba(0, 0, 0, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 12px;
}

#dealt-area.drag-over {
    border-color: var(--gold);
    background: rgba(201, 169, 89, 0.08);
}

#dealt-cards {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    min-height: 112px;
    padding: 4px;
}

#dealt-count {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.8rem;
}

#sorting-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

#validation-message {
    text-align: center;
    padding: 8px;
    font-size: 0.9rem;
    border-radius: 6px;
    min-height: 20px;
}

#validation-message.valid {
    background: rgba(76, 175, 80, 0.15);
    color: var(--success);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

#validation-message.invalid {
    background: rgba(239, 83, 80, 0.15);
    color: var(--error);
    border: 1px solid rgba(239, 83, 80, 0.3);
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
    width: var(--card-width);
    height: var(--card-height);
    border-radius: var(--card-radius);
    overflow: hidden;
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: var(--card-shadow);
    position: relative;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
    background: #fff;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 2px 4px 14px rgba(0, 0, 0, 0.6);
    z-index: 10;
}

.card.selected {
    transform: translateY(-10px);
    box-shadow: 0 0 0 3px var(--gold), 0 4px 16px rgba(201, 169, 89, 0.5);
    z-index: 20;
}

.card.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.card img {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

.card.small {
    width: var(--card-sm-width);
    height: var(--card-sm-height);
}

.card.no-hover:hover {
    transform: none;
    box-shadow: var(--card-shadow);
    cursor: default;
}

.card.no-hover {
    cursor: default;
}

/* Card Back */
.card-back {
    background:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 4px,
            rgba(201, 169, 89, 0.12) 4px,
            rgba(201, 169, 89, 0.12) 8px
        ),
        linear-gradient(180deg, #1a237e 0%, #283593 50%, #1a237e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2.5px solid var(--gold);
}

.card-back::before {
    content: '';
    position: absolute;
    inset: 5px;
    border: 1.5px solid var(--gold);
    border-radius: 3px;
    pointer-events: none;
}

.card-back-text {
    color: var(--gold);
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 3px;
    z-index: 1;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.card-back.small .card-back-text {
    font-size: 8px;
    letter-spacing: 2px;
}

/* Card Fallback */
.card-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 2px solid #999;
    background: #fff;
}

.card-fallback .fb-rank {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
}

.card-fallback .fb-suit {
    font-size: 1.8rem;
    line-height: 1;
}

.card-fallback.small .fb-rank {
    font-size: 0.9rem;
}

.card-fallback.small .fb-suit {
    font-size: 1.3rem;
}

.card-fallback.red {
    color: #d32f2f;
}

.card-fallback.black {
    color: #212121;
}

/* Card Flip Animation */
.card.flipping {
    animation: cardFlip 0.5s ease-in-out;
}

@keyframes cardFlip {
    0% { transform: scaleX(1); }
    50% { transform: scaleX(0); }
    100% { transform: scaleX(1); }
}

/* ============================================================
   REVEAL SCREEN
   ============================================================ */

#reveal-table {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#screen-reveal {
    padding-bottom: 80px;
}

.comparison-group {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 14px;
}

.comparison-group h3 {
    font-size: 1rem;
    color: var(--gold);
    margin-bottom: 10px;
    text-align: center;
    letter-spacing: 1px;
}

.comparison-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comparison-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.comparison-row.winner-row {
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.comparison-row .player-label {
    min-width: 90px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.comparison-row .hand-cards {
    display: flex;
    gap: 4px;
}

.comparison-row .hand-type-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: 10px;
    font-style: italic;
    min-width: 140px;
}

.comparison-result {
    text-align: center;
    margin-top: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 6px;
    border-radius: 6px;
    min-height: 30px;
}

.comparison-result.awarded {
    background: rgba(76, 175, 80, 0.15);
    color: var(--success);
}

.comparison-result.tied {
    background: rgba(255, 152, 0, 0.15);
    color: var(--warning);
}

.comparison-result.no-hands {
    color: var(--text-secondary);
}

#reveal-actions {
    position: fixed;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    transform: translateX(-50%);
    z-index: 900;
    margin-top: 0;
    text-align: center;
    pointer-events: none;
}

#reveal-actions #btn-lay-hand {
    pointer-events: auto;
    min-width: 180px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Bonus Banner */
.bonus-banner {
    text-align: center;
    padding: 10px 16px;
    margin: 8px 0;
    background: linear-gradient(135deg, rgba(201, 169, 89, 0.2), rgba(201, 169, 89, 0.05));
    border: 2px solid var(--gold);
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--gold-light);
    animation: bonusPulse 1s ease-in-out 2;
}

@keyframes bonusPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* ============================================================
   ROUND END SCREEN
   ============================================================ */

#round-summary {
    max-width: 500px;
    margin: 30px auto;
    padding: 30px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    text-align: center;
}

#round-summary h3 {
    color: var(--gold);
    margin-bottom: 16px;
    font-size: 1.3rem;
}

#round-summary .score-list {
    list-style: none;
    margin-bottom: 20px;
}

#round-summary .score-list li {
    padding: 6px 0;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#round-summary .score-list li:last-child {
    border-bottom: none;
}

#screen-round-end {
    text-align: center;
}

/* ============================================================
   GAME LOG
   ============================================================ */

#game-log {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 10px;
    margin-top: 12px;
    max-height: 200px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#game-log h4 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#log-entries {
    overflow-y: auto;
    flex: 1;
    font-size: 0.82rem;
    line-height: 1.7;
}

.log-entry {
    padding: 2px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    animation: fadeIn 0.3s ease;
}

.log-entry.log-info {
    color: var(--text-secondary);
}

.log-entry.log-success {
    color: var(--success);
}

.log-entry.log-warning {
    color: var(--warning);
}

.log-entry.log-error {
    color: var(--error);
}

.log-entry.log-bonus {
    color: var(--gold-light);
    font-weight: 600;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   MODALS
   ============================================================ */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #1e2d25;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 30px;
    max-width: 420px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-wide {
    max-width: 550px;
}

.modal h2 {
    color: var(--gold);
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.4rem;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--gold);
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
}

.stat-item {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    padding: 14px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold-light);
}

/* Game Over specifics */
#gameover-body {
    margin-bottom: 20px;
}

#gameover-body .go-result {
    font-size: 1.1rem;
    margin-bottom: 16px;
    text-align: center;
}

#gameover-body .go-result.won {
    color: var(--success);
}

#gameover-body .go-result.lost {
    color: var(--error);
}

#gameover-body .go-scores {
    list-style: none;
    margin-bottom: 10px;
}

#gameover-body .go-scores li {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#gameover-body .go-lifetime {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

#gameover-body .go-lifetime h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#gameover-body .go-lifetime p {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
}

#modal-confirm .modal p {
    text-align: center;
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

/* ============================================================
   FOOTER
   ============================================================ */

footer {
    text-align: center;
    padding: 14px 0;
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: auto;
}

.home-footer-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.home-footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 700;
}

.home-footer-links a:hover,
.home-footer-links a:focus-visible {
    color: var(--gold-light);
    outline: none;
}

/* ============================================================
   CONTENT PAGES (ABOUT / CONTACT / TERMS / PRIVACY)
   ============================================================ */

.site-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header {
    padding: 12px 0;
    border-bottom: 2px solid var(--gold);
    margin-bottom: 12px;
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.site-logo {
    display: block;
    width: 220px;
    max-width: 52vw;
    height: auto;
}

.site-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.site-nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.site-nav-link:hover,
.site-nav-link:focus-visible {
    background: rgba(0, 0, 0, 0.32);
    border-color: rgba(201, 169, 89, 0.35);
    transform: translateY(-1px);
    outline: none;
}

.content-page {
    flex: 1;
}

.content-card {
    max-width: 900px;
    margin: 22px auto 0;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 22px;
}

.content-card h1 {
    color: var(--gold);
    margin-bottom: 12px;
    text-align: left;
    letter-spacing: 0.5px;
}

.content-card h2 {
    color: var(--gold-light);
    margin: 18px 0 8px;
    font-size: 1.1rem;
}

.content-card p,
.content-card li {
    color: var(--text-secondary);
    line-height: 1.75;
}

.content-card ul {
    padding-left: 18px;
    margin: 10px 0 6px;
}

.content-card a {
    color: var(--gold-light);
}

.content-callout {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(201, 169, 89, 0.25);
    background: rgba(0, 0, 0, 0.18);
}

.profile-photo-wrap {
    float: right;
    margin: 0 0 12px 14px;
}

.profile-photo {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 999px;
    border: 2px solid rgba(201, 169, 89, 0.35);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.reveal-email {
    margin: 16px 0 10px;
    padding: 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.reveal-email-label {
    margin-right: auto;
}

.reveal-email-target {
    color: var(--text-primary);
    font-weight: 700;
}

.reveal-email-link {
    color: var(--gold-light);
    text-decoration: none;
    font-weight: 800;
}

.contact-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    font-size: 0.95rem;
    resize: vertical;
}

.contact-form textarea:focus {
    outline: none;
    border-color: var(--gold);
}

.hp-field {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.contact-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.contact-back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 700;
}

.form-alert {
    margin: 14px 0 12px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.form-alert-success {
    background: rgba(76, 175, 80, 0.15);
    border-color: rgba(76, 175, 80, 0.25);
    color: var(--success);
    font-weight: 700;
}

.form-alert-error {
    background: rgba(239, 83, 80, 0.15);
    border-color: rgba(239, 83, 80, 0.25);
    color: var(--error);
    font-weight: 700;
}

.site-footer {
    margin-top: auto;
    padding: 18px 0 12px;
    text-align: center;
    color: var(--text-secondary);
}

.site-footer-inner {
    max-width: 900px;
    margin: 0 auto;
}

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

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

.site-footer-links a:hover,
.site-footer-links a:focus-visible {
    color: var(--gold-light);
    outline: none;
}

.site-footer-note {
    margin: 6px 0 8px;
}

.site-footer-copy {
    display: block;
    margin-top: 6px;
}

@media (max-width: 768px) {
    .site-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-nav {
        justify-content: flex-start;
    }

    .profile-photo-wrap {
        float: none;
        margin: 0 0 14px 0;
    }
}

/* ============================================================
   HOMEPAGE SEO CONTENT (outside game screens)
   ============================================================ */

#homepage-seo-content {
    max-width: 900px;
    margin: 18px auto 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#homepage-seo-content .homepage-seo-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 18px;
}

#homepage-seo-content h2 {
    color: var(--gold);
    font-size: 1.25rem;
    margin-bottom: 10px;
    text-align: center;
}

#homepage-seo-content h3 {
    color: var(--gold-light);
    font-size: 1rem;
    margin: 14px 0 8px;
}

#homepage-seo-content p,
#homepage-seo-content li {
    color: var(--text-secondary);
    line-height: 1.65;
}

#homepage-seo-content ul {
    margin-top: 10px;
    padding-left: 18px;
}

#homepage-seo-content .homepage-table-scroll {
    margin-top: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
}

#homepage-seo-content .homepage-seo-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
}

#homepage-seo-content .homepage-seo-table th,
#homepage-seo-content .homepage-seo-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
    vertical-align: top;
    font-size: 0.92rem;
}

#homepage-seo-content .homepage-seo-table th {
    color: var(--text-primary);
    font-weight: 700;
    background: rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
}

#homepage-seo-content .homepage-faq-item + .homepage-faq-item {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    :root {
        --card-width: 64px;
        --card-height: 90px;
        --card-sm-width: 48px;
        --card-sm-height: 67px;
    }

    header h1 {
        font-size: 1.4rem;
        letter-spacing: 4px;
    }

    .site-title {
        font-size: 1.4rem;
        letter-spacing: 4px;
    }

    #hand-slots-container {
        grid-template-columns: repeat(2, 1fr);
    }

    #game-info-bar {
        font-size: 0.75rem;
        gap: 10px;
    }

    .score-item {
        padding: 8px 10px;
        font-size: 0.82rem;
    }

    .score-item .score-value {
        font-size: 1.2rem;
    }

    .comparison-row {
        flex-wrap: wrap;
    }

    .comparison-row .player-label {
        min-width: 70px;
    }

    .comparison-row .hand-type-label {
        min-width: auto;
        margin-left: 0;
        width: 100%;
    }

    .btn-lg {
        padding: 10px 24px;
        font-size: 1rem;
    }

    #screen-reveal {
        padding-bottom: 72px;
    }

    #reveal-actions {
        width: calc(100% - 24px);
    }

    #reveal-actions #btn-lay-hand {
        width: min(100%, 320px);
    }

    .welcome-box {
        padding: 24px;
        margin: 20px auto;
    }

    #homepage-seo-content {
        max-width: 600px;
    }
}

@media (max-width: 480px) {
    html,
    body {
        overflow-x: hidden;
    }

    :root {
        --card-width: 52px;
        --card-height: 73px;
        --card-sm-width: 40px;
        --card-sm-height: 56px;
    }

    header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    #scoreboard {
        flex-direction: column;
    }

    #hand-slots-container {
        grid-template-columns: 1fr 1fr;
    }

    .hand-slot {
        min-height: 110px;
    }

    .slot-cards {
        min-height: 73px;
    }

    #sorting-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .card-back-text {
        font-size: 8px;
        letter-spacing: 1px;
    }

    #homepage-seo-content .homepage-seo-card {
        padding: 14px;
    }

    #homepage-seo-content {
        width: 100%;
        max-width: 100%;
    }

    #homepage-seo-content .homepage-table-scroll {
        max-width: 100%;
    }
}

/* ============================================================
   DROP ZONE VISUAL FEEDBACK
   ============================================================ */

.drop-zone {
    transition: background 0.2s ease, border-color 0.2s ease;
}

.drop-zone.drag-over {
    background: rgba(201, 169, 89, 0.08);
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

.text-center {
    text-align: center;
}

.mt-10 {
    margin-top: 10px;
}

.hidden {
    display: none !important;
}

/* Score change animation */
.score-flash {
    animation: scoreFlash 0.6s ease;
}

@keyframes scoreFlash {
    0% { background: rgba(76, 175, 80, 0.3); }
    100% { background: var(--panel-bg); }
}
