body {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.game-container {
    text-align: center;
    max-width: 1100px;
    width: 100%;
}

h1 { color: var(--primary-color); margin: 0; }

.setup-screen,
.game-area {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin: 20px auto;
}

.setup-screen { max-width: 430px; }

.input-group {
    margin: 15px 0;
    text-align: left;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #2c3e50;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 11px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
}

.setup-note,
#pass-helper {
    color: #5d6d7e;
    font-size: 0.92rem;
}

.status {
    font-size: 1.1rem;
    margin-bottom: 10px;
    font-weight: bold;
    color: #2c3e50;
    min-height: 1.5em;
}

.hearts-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.hearts-meta span {
    background: #f4f6f7;
    border: 1px solid #dfe6e9;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.88rem;
    color: #34495e;
}

.scoreboard {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.score-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 10px;
}

.score-card.current {
    border-color: #3498db;
    background: #eef7ff;
}

.score-card .name {
    font-weight: 700;
    color: #2c3e50;
}

.score-card .score {
    font-size: 1.25rem;
    font-weight: 800;
    color: #c0392b;
}

.score-card .round-score {
    font-size: 0.8rem;
    color: #5d6d7e;
}

.table-area {
    display: grid;
    grid-template-columns: minmax(230px, 1fr) minmax(260px, 1.4fr);
    gap: 16px;
    align-items: stretch;
    margin-bottom: 16px;
}

.players-table {
    display: grid;
    gap: 10px;
}

.player-panel {
    background: #fbfcfc;
    border: 2px solid #e5e8e8;
    border-radius: 10px;
    padding: 10px;
    text-align: left;
}

.player-panel.active {
    border-color: #f1c40f;
    background: #fffaf0;
}

.player-panel.human {
    border-color: #85c1e9;
}

.player-panel .player-topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
}

.player-panel .name {
    font-weight: 700;
    color: #2c3e50;
}

.player-panel .badge {
    font-size: 0.75rem;
    border-radius: 999px;
    padding: 3px 8px;
    color: white;
    background: #7f8c8d;
}

.player-panel.active .badge { background: #d68910; }
.player-panel.human .badge { background: #2980b9; }

.mini-hand {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    min-height: 26px;
}

.card-back-mini {
    width: 18px;
    height: 25px;
    border-radius: 4px;
    background: linear-gradient(135deg, #1a5276, #8e44ad);
    border: 1px solid rgba(255,255,255,0.65);
    box-shadow: 0 1px 2px rgba(0,0,0,0.18);
}

.trick-area {
    background: radial-gradient(circle at center, #1f8a5f 0%, #11613f 100%);
    border-radius: 14px;
    padding: 18px;
    color: white;
    min-height: 230px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.trick-area h3 {
    margin-top: 0;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

.trick-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(70px, 1fr));
    gap: 10px;
    align-items: center;
    justify-items: center;
    min-height: 105px;
}

.trick-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-height: 100px;
}

.trick-slot .slot-name {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.86);
}

.action-log {
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.24);
    border-radius: 8px;
    padding: 10px;
    margin-top: 12px;
    font-size: 0.9rem;
    min-height: 2em;
    color: white;
}

.pass-panel {
    background: #fff8e1;
    border: 2px solid #f5c542;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 16px;
}

.pass-panel h3 { margin: 0 0 6px; color: #7d6608; }

.hand-area { margin-bottom: 18px; }
.hand-area h3 { font-size: 0.95rem; color: #566573; margin-bottom: 8px; }

.hand {
    display: flex;
    gap: 7px;
    justify-content: center;
    flex-wrap: wrap;
}

.card {
    width: 58px;
    height: 82px;
    background: white;
    border: 2px solid #d5d8dc;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
    user-select: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.12);
}

.card.playable:hover,
.card.selectable:hover {
    transform: translateY(-7px);
    box-shadow: 0 7px 12px rgba(0,0,0,0.2);
}

.card.disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.card.selected {
    border-color: #f39c12;
    background: #fff8e1;
    transform: translateY(-9px);
}

.card .rank { font-size: 1.12rem; font-weight: 800; }
.card .suit { font-size: 1.28rem; }
.card.hearts, .card.diamonds { color: #c0392b; }
.card.clubs, .card.spades { color: #1f2d3d; }

.card.penalty {
    border-color: #e74c3c;
}

.game-buttons,
.online-info {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.opponent-name {
    font-weight: 600;
    color: var(--text-muted, #666);
}

@media (max-width: 760px) {
    .game-area { padding: 15px; }
    .scoreboard { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
    .table-area { grid-template-columns: 1fr; }
    .trick-cards { grid-template-columns: repeat(2, minmax(90px, 1fr)); }
    .card { width: 48px; height: 68px; font-size: 0.82rem; }
}

@media (max-width: 430px) {
    .scoreboard { grid-template-columns: 1fr; }
    .hearts-meta { flex-direction: column; }
    .card { width: 43px; height: 62px; }
}
