/* go-fish.css — Fruggia Go Fish */

/* == Card sizing == */
.gf-area {
    --gf-cw: 52px;
    --gf-ch: calc(var(--gf-cw) * 1.4);
    max-width: 540px;
    margin: 0 auto;
    user-select: none;
}

.gf-area .fc-card {
    width: var(--gf-cw);
    height: var(--gf-ch);
    animation: none;
    flex-shrink: 0;
}
.gf-area .fc-rank   { font-size: calc(var(--gf-cw) * 0.165); }
.gf-area .fc-suit   { font-size: calc(var(--gf-cw) * 0.13); }
.gf-area .fc-center { font-size: calc(var(--gf-cw) * 0.33); }
.gf-area .fc-tl { top: calc(var(--gf-cw) * 0.054); left: calc(var(--gf-cw) * 0.082); }
.gf-area .fc-br { bottom: calc(var(--gf-cw) * 0.054); right: calc(var(--gf-cw) * 0.082); }

/* == Green felt table == */
.gf-table {
    background: #14532d;
    border-radius: 16px;
    padding: 1rem 1.25rem;
    box-shadow: 0 4px 20px rgba(0,0,0,.35);
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    overflow: visible;
}

/* == Zone rows == */
.gf-zone {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
}

.gf-zone-label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 60px;
}
.gf-player-name {
    color: rgba(255,255,255,.85);
    font-weight: 700;
    font-size: 0.85rem;
}
.gf-count-badge {
    color: rgba(255,255,255,.45);
    font-size: 0.72rem;
}
.gf-book-label {
    color: rgba(255,255,255,.45);
    font-size: 0.68rem;
    margin-top: 4px;
}

/* == Hand areas — fanned == */
.gf-hand {
    display: flex;
    flex-wrap: nowrap;
    flex: 1;
    align-items: flex-end;
    min-height: calc(var(--gf-ch) + 16px); /* headroom for lifted cards */
    padding-top: 16px;
}

/* Fan overlap: each card slides ~52% under the next */
.gf-hand .fc-card {
    margin-right: calc(var(--gf-cw) * -0.52);
}
.gf-hand .fc-card:last-child {
    margin-right: 0;
}

/* Selectable state */
.gf-card--selectable {
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s;
    position: relative; /* enables z-index in flex context */
}
.gf-card--selectable:hover {
    transform: translateY(-8px);
    box-shadow: 0 6px 16px rgba(0,0,0,.35);
    z-index: 10;
}
.gf-card--selected {
    transform: translateY(-14px) !important;
    box-shadow: 0 0 0 3px #fbbf24, 0 8px 20px rgba(251,191,36,.4) !important;
    z-index: 20;
}

/* == Books area == */
.gf-books {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 70px;
    max-width: 110px;
    align-items: flex-start;
    align-content: flex-start;
}

.gf-book-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: #fbbf24;
    color: #1e293b;
    font-size: 0.72rem;
    font-weight: 800;
    font-family: Georgia, serif;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
}

/* == Centre divider (stock + message) == */
.gf-center {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.25rem 0;
    border-top: 1px solid rgba(255,255,255,.08);
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.gf-stock-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,.55);
    font-size: 0.78rem;
}
.gf-stock-icon {
    width: var(--gf-cw);
    height: var(--gf-ch);
    border: 2px dashed rgba(255,255,255,.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: rgba(255,255,255,.25);
}

/* == Message == */
#gf-msg {
    flex: 1;
    color: rgba(255,255,255,.88);
    font-size: 0.82rem;
    line-height: 1.35;
    text-align: right;
}

/* == Ask bar == */
.gf-ask-bar {
    margin-top: 0.75rem;
    display: flex;
    justify-content: center;
    transition: opacity 0.2s, transform 0.2s;
}
.gf-ask-bar--hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
}
#gf-ask-btn {
    padding: 11px 28px;
    font-size: 1rem;
    font-weight: 700;
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
#gf-ask-btn:hover  { background: #15803d; }
#gf-ask-btn:active { transform: scale(0.96); }

/* == Memory logs == */
.gf-memory-section {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.gf-memory-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.72rem;
    color: var(--text-muted, #64748b);
}
.gf-memory-label {
    white-space: nowrap;
}
.gf-memory-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    border-radius: 5px;
    background: #e2e8f0;
    color: #334155;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: Georgia, serif;
}
[data-theme="dark"] .gf-memory-chip {
    background: #334155;
    color: #e2e8f0;
}

/* Last chip in Finn's ask log — highlights most recent ask */
#gf-player-memory-chips .gf-memory-chip:last-child {
    background: #fef3c7;
    color: #92400e;
    outline: 2px solid #fbbf24;
    outline-offset: 1px;
}

/* Finn last took — persistent haul line */
.gf-finn-haul-value {
    font-weight: 700;
    color: #f87171;
    font-size: 0.75rem;
}

/* == Controls (stats + new game) == */
.gf-controls {
    margin-top: 0.875rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
}
.gf-stats { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* == Overlay == */
.gf-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: rgba(15,23,42,.88);
    color: #f1f5f9;
    text-align: center;
    padding: 1.5rem;
    z-index: 100;
}
.gf-overlay.hidden { display: none; }
.gf-overlay h2 { font-size: 1.6rem; }
.gf-overlay p  { font-size: 0.9rem; color: #94a3b8; }

/* == Dark theme == */
[data-theme="dark"] .stat-box { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .stat-box .value { color: #f1f5f9; }
