/**
 * HOKM - Game CSS
 * Spieltisch, Karten, Overlays
 */

/* ========== GAME CONTAINER ========== */
.game-container {
    padding: 10px;
    max-width: 100%;
}

/* ========== SCOREBOARD ========== */
.scoreboard {
    display: flex;
    justify-content: space-around;
    background: var(--bg-card);
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 10px;
}

.team-score { text-align: center; }
.team-score h4 {
    color: var(--text-dim);
    margin-bottom: 3px;
    font-size: 0.8em;
}
.team-score .rounds {
    font-size: 1.4em;
    font-weight: bold;
}
.team-score .tricks {
    color: var(--text-dim);
    font-size: 0.8em;
}
.team-score.your-team .rounds { color: var(--accent-green); }

/* ========== TABLE AREA ========== */
.table-area {
    background: radial-gradient(ellipse, #2d5a3d 0%, #1a3a25 100%);
    border-radius: 12px;
    padding: 10px;
    position: relative;
    border: 4px solid #5a3d2b;
    min-height: auto;
}

.table-center {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80px;
    gap: 5px;
    flex-wrap: wrap;
}

.player-area { margin: 10px 0; }

.player-label {
    background: var(--bg-card);
    padding: 5px 10px;
    border-radius: 15px;
    display: inline-block;
    margin-bottom: 6px;
    font-size: 0.85em;
}
.player-label.current {
    background: var(--accent);
    animation: pulse 1s infinite;
}
.player-label.hakem::after { content: " 👑"; }

/* ========== CARDS ========== */
.card {
    width: var(--card-width);
    height: var(--card-height);
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    margin: 0 -6px;
    transition: transform 0.15s;
    flex-shrink: 0;
}
.card.red { color: #e74c3c; }
.card.black { color: #2c3e50; }
.card .rank { font-size: 14px; font-weight: bold; }
.card .suit { font-size: 18px; }
.card.playable {
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-green);
}
.card.playable:hover, .card.playable:active {
    transform: translateY(-10px) scale(1.05);
    z-index: 10;
}
.card:not(.playable) { opacity: 0.6; }
.card.back {
    background: linear-gradient(135deg, #1a3a5c, #0d1f33);
    border: 2px solid #2a4a6c;
    width: calc(var(--card-width) * 0.7);
    height: calc(var(--card-height) * 0.7);
}

.hand {
    display: flex;
    justify-content: center;
    padding: 10px 5px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}
.hand .card { scroll-snap-align: center; }

/* ========== TRUMP SELECTION ========== */
.trump-selection {
    text-align: center;
    padding: 15px;
}

.suit-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 15px 0;
}

.suit-btn {
    aspect-ratio: 3/4;
    background: var(--bg-card);
    border: 2px solid #333;
    border-radius: 8px;
    cursor: pointer;
    font-size: 28px;
    transition: all 0.2s;
    min-height: 60px;
}
.suit-btn:hover, .suit-btn:active {
    border-color: var(--accent);
    transform: scale(1.05);
}
.suit-btn.hearts, .suit-btn.diamonds { color: #e74c3c; }
.suit-btn.clubs, .suit-btn.spades { color: #fff; }

.trump-display { font-size: 1.1em; }
.trump-symbol { font-size: 1.1em; }
.trump-symbol.red { color: #e74c3c; }

/* ========== HAKEM REVEAL OVERLAY ========== */
.hakem-reveal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 15px;
}
.hakem-reveal-overlay h2 {
    margin-bottom: 20px;
    font-size: 1.1em;
    color: var(--text-dim);
    text-align: center;
}

.hakem-reveal-players {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 25px;
    width: 100%;
    max-width: 280px;
}

.hakem-reveal-player {
    padding: 12px;
    background: var(--bg-card);
    border-radius: 10px;
    text-align: center;
    border: 2px solid #333;
    transition: all 0.3s ease;
}
.hakem-reveal-player .avatar {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: 50%;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
}
.hakem-reveal-player .name { font-size: 0.85em; }
.hakem-reveal-player.highlight {
    border-color: gold;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    transform: scale(1.05);
}
.hakem-reveal-player.winner {
    border-color: gold;
    background: linear-gradient(135deg, #1a3a2e, #0d1f18);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    transform: scale(1.08);
}
.hakem-reveal-player.winner .avatar {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #000;
}

.hakem-reveal-result {
    font-size: 1.3em;
    font-weight: bold;
    color: gold;
    opacity: 0;
    transition: opacity 0.5s;
    text-align: center;
}
.hakem-reveal-result.visible { opacity: 1; }
.crown-icon { font-size: 1.2em; margin-bottom: 4px; }

/* ========== TRICK WINNER OVERLAY ========== */
.trick-winner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 150;
    opacity: 0;
    transition: opacity 0.3s;
    padding: 15px;
}
.trick-winner-overlay.visible { opacity: 1; }

.trick-winner-card {
    background: var(--bg-card);
    padding: 20px 30px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid var(--accent-green);
    transform: scale(0.8);
    transition: transform 0.3s;
    max-width: 90%;
}
.trick-winner-overlay.visible .trick-winner-card { transform: scale(1); }
.trick-winner-card h3 { font-size: 1.2em; margin-bottom: 8px; }
.trick-winner-card .winner-name {
    font-size: 1em;
    color: var(--accent-green);
}

/* ========== RESULT OVERLAYS ========== */
.result-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 180;
    padding: 15px;
}

.result-card {
    background: linear-gradient(135deg, var(--bg-card), #1a2a4e);
    padding: 25px 20px;
    border-radius: 15px;
    text-align: center;
    width: 100%;
    max-width: 320px;
}
.result-card.win {
    border: 3px solid var(--accent-green);
    box-shadow: 0 0 40px rgba(78, 204, 163, 0.4);
}
.result-card.lose {
    border: 3px solid var(--accent);
    box-shadow: 0 0 40px rgba(233, 69, 96, 0.4);
}

.result-icon { font-size: 3em; margin-bottom: 15px; }
.result-card h2 { font-size: 1.5em; margin-bottom: 10px; }
.result-card.win h2 { color: var(--accent-green); }
.result-card.lose h2 { color: var(--accent); }
.result-score { font-size: 2em; font-weight: bold; margin: 15px 0; }

.result-coins {
    font-size: 1.1em;
    margin: 15px 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}
.result-coins.positive { color: var(--accent-green); }
.result-coins.negative { color: var(--accent); }

.result-btn {
    margin-top: 15px;
    padding: 12px 30px;
    font-size: 1em;
    width: 100%;
}
