/* Wizard Extreme Web App - Styles */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #f0f0f0;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: #ffd700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hidden {
    display: none !important;
}

/* Lobby */
#difficulty-select {
    text-align: center;
    padding: 40px 20px;
}

#difficulty-select h2 {
    margin-bottom: 30px;
    color: #a0a0a0;
}

.lobby {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.opponent-select {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    min-width: 120px;
}

.opponent-label {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #ffd700;
}

.vs-label {
    font-size: 24px;
    font-weight: bold;
    color: #666;
}

.difficulty-dropdown {
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    background: #333;
    color: #fff;
    cursor: pointer;
}

.difficulty-dropdown:focus {
    outline: 2px solid #ffd700;
}

.start-btn {
    padding: 15px 50px;
    font-size: 20px;
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    color: #000;
    font-weight: bold;
}

/* Loading */
#loading {
    text-align: center;
    padding: 60px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #333;
    border-top-color: #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Game Area */
#game-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#status {
    text-align: center;
    font-size: 16px;
    color: #a0a0a0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

/* Table Layout */
.table {
    background: linear-gradient(135deg, #1e5a3a 0%, #166534 100%);
    border-radius: 150px;
    padding: 30px;
    min-height: 300px;
    position: relative;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
}

/* Opponent Areas */
.opponents-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.opponent {
    text-align: center;
    flex: 1;
    max-width: 200px;
}

.opponent-name {
    font-size: 14px;
    color: #a0a0a0;
    margin-bottom: 5px;
}

.opponent-hand {
    display: flex;
    justify-content: center;
}

.opponent-seals {
    display: flex;
    justify-content: center;
    /* Removed gap to let groups handle spacing */
    margin-top: 10px;
}

/* Trick Area - Triangle Layout */
#trick-area {
    position: relative;
    min-height: 140px;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.trick-card {
    position: absolute;
    transition: transform 0.3s, opacity 0.3s;
}

/* Player 0 (You) - bottom center */
.trick-pos-0 {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) rotate(-5deg);
}

/* Player 1 (AI 1 - left) - top left */
.trick-pos-1 {
    top: 0;
    left: 15%;
    transform: rotate(-15deg);
}

/* Player 2 (AI 2 - right) - top right */
.trick-pos-2 {
    top: 0;
    right: 15%;
    transform: rotate(15deg);
}

/* Pool */
#pool-seals {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

.seals-container {
    display: flex;
    gap: 10px;
    margin-left: 10px;
}

.seal-label {
    color: #a0a0a0;
    font-size: 14px;
}

/* Player Area */
.player-area {
    text-align: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

#player-hand {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

#player-seals {
    display: flex;
    justify-content: center;
    /* Removed gap to let groups handle spacing */
    margin-top: 10px;
}

/* Cards */
.card {
    width: 50px;
    height: 75px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: default;
    gap: 2px;
}

.card-back {
    background: linear-gradient(135deg, #333 0%, #555 100%);
    width: 35px;
    height: 52px;
    margin: 0 -5px;
}

.card-value {
    font-size: 18px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    line-height: 1;
}

.card-emoji {
    font-size: 16px;
    line-height: 1;
}

.card-color-0 {
    background: linear-gradient(135deg, #ff5252 0%, #ff1744 100%);
    color: #fff;
}

/* Red */
.card-color-1 {
    background: linear-gradient(135deg, #448aff 0%, #2979ff 100%);
    color: #fff;
}

/* Blue */
.card-color-2 {
    background: linear-gradient(135deg, #ffeb3b 0%, #ffc107 100%);
    color: #000;
}

/* Yellow */
.card-color-3 {
    background: linear-gradient(135deg, #69f0ae 0%, #00e676 100%);
    color: #000;
}

/* Green */
.card-color-4 {
    background: linear-gradient(135deg, #ce93d8 0%, #ab47bc 100%);
    color: #fff;
}

/* Purple */

.card.playable {
    cursor: pointer;
    border: 2px solid #ffd700;
}

.card.playable:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.4);
}

/* Seals */
.seal {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    /* Prevent hover issues on overlap */
}

/* Groups of seals for overlap effect */
.seal-group {
    display: flex;
    margin-right: 12px;
    /* Spacing between color groups */
}

.seal-group .seal {
    margin-left: -18px;
    /* Negative margin for overlap */
    position: relative;
    z-index: 1;
}

.seal-group .seal:first-child {
    margin-left: 0;
    z-index: 0;
}

.seal-color-0 {
    background: #ff5252;
    color: #fff;
}

.seal-color-1 {
    background: #448aff;
    color: #fff;
}

.seal-color-2 {
    background: #ffeb3b;
    color: #000;
}

.seal-color-3 {
    background: #69f0ae;
    color: #000;
}

.seal-color-4 {
    background: #ce93d8;
    color: #fff;
}

.seal-black {
    background: #333;
    color: #fff;
    border: 2px solid #ff5252;
}

/* Bid Buttons */
#bid-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.bid-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}

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

.bid-btn:not(:disabled):hover {
    transform: scale(1.05);
}

.bid-btn[data-action="0"] {
    background: #ff5252;
    color: #fff;
}

.bid-btn[data-action="1"] {
    background: #448aff;
    color: #fff;
}

.bid-btn[data-action="2"] {
    background: #ffeb3b;
    color: #000;
}

.bid-btn[data-action="3"] {
    background: #69f0ae;
    color: #000;
}

.bid-btn[data-action="4"] {
    background: #ce93d8;
    color: #fff;
}

.bid-btn[data-action="5"] {
    background: #666;
    color: #fff;
}

/* Game Over */
#game-over {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20, 20, 40, 0.98);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    z-index: 100;
}

#game-over h2 {
    color: #ffd700;
    margin-bottom: 20px;
}

.scores {
    margin-bottom: 20px;
}

.score-row {
    padding: 10px;
    font-size: 18px;
}

.score-row.winner {
    color: #4ade80;
    font-weight: bold;
}

.btn {
    padding: 12px 30px;
    font-size: 16px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.btn:hover {
    opacity: 0.9;
}