/* === RADIAL TABLE & BACKGROUND CANVAS === */
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background-color: #172237;
    color: white; margin: 0; padding: 0; overflow: hidden; height: 100vh; width: 100vw;
}
.hidden { display: none !important; }

/* === LOBBY SYSTEM === */
#join-screen {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: rgba(30, 41, 59, 0.95); border: 2px solid #334155;
    border-radius: 15px; width: 450px; padding: 30px 40px; text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8); z-index: 1000;
}
#join-screen h1 { color: #3b82f6; margin-top:0; }
input[type="text"] {
    padding: 12px; font-size: 1.1rem; border-radius: 8px; border: 1px solid #475569;
    width: 80%; text-align: center; margin-bottom: 20px; background: #0f172a; color: white;
}
.btn {
    background: #3b82f6; color: #fff; border: none; padding: 12px 25px;
    font-size: 1.1rem; font-weight: bold; border-radius: 8px; cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); transition: background 0.2s; margin: 5px;
}
.btn:hover { background: #2563eb; }
.btn-green { background: #10b981; width: 100%; } .btn-green:hover { background: #059669; }
#waiting-list { list-style: none; padding: 0; max-height: 120px; overflow-y: auto; }
#waiting-list li { background: rgba(0,0,0,0.3); margin: 5px; padding: 8px; border-radius: 5px; }

.instructions {
    background: rgba(0,0,0,0.2); border-radius: 8px; padding: 15px;
    margin-top: 20px; text-align: left; font-size: 0.9rem; color: #cbd5e1; border: 1px solid #475569;
}
.instructions h4 { margin: 0 0 10px 0; color: #fbbf24; text-align: center; }

/* === THE CENTRAL OVAL OBLONG TABLE === */
#felt-table {
    position: absolute; top: 45%; left: 50%; transform: translate(-50%, -50%);
    width: 70vw; height: 45vh; min-width: 550px; min-height: 320px;
    background: #141b26; border-radius: 50%; border: 10px solid #1c2738;
    box-shadow: 0 25px 60px rgba(0,0,0,0.7), inset 0 0 40px rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center; z-index: 1;
}

/* Background Directional Loops tracking game orientation flow */
#table-direction-arrow {
    position: absolute; width: 85%; height: 85%; border-radius: 50%;
    border: 6px dashed rgba(239, 68, 68, 0.15); pointer-events: none;
}

#center-board { display: flex; gap: 30px; z-index: 5; }

#turn-status-container {
    position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
    text-align: center; background: rgba(15, 23, 42, 0.85); padding: 8px 35px;
    border-radius: 30px; border: 1px solid #334155; z-index: 10;
}
#turn-status { margin: 0; font-size: 1.3rem; color: #fbbf24; text-transform: uppercase; letter-spacing: 1px; }
#direction-indicator { margin: 2px 0 0 0; font-size: 0.8rem; color: #94a3b8; }

/* === RADIAL SEATING ARRANGEMENT === */
.opponent-seat {
    position: absolute; transform: translate(-50%, -50%);
    display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 10;
}
.opp-avatar {
    background: #1f2937; border: 2px solid #4b5563; border-radius: 8px;
    padding: 8px 16px; text-align: center; font-weight: bold; font-size: 0.95rem;
    box-shadow: 0 6px 12px rgba(0,0,0,0.5); position: relative;
}
.opp-cards {
    background: #ef4444; color: white; font-weight: bold; font-size: 1.1rem;
    width: 36px; height: 52px; border-radius: 5px; border: 2px solid white;
    display: flex; justify-content: center; align-items: center; box-shadow: 0 4px 6px rgba(0,0,0,0.4);
}
.active-turn .opp-avatar { border-color: #10b981; box-shadow: 0 0 15px rgba(16, 185, 129, 0.6); }

.kick-btn {
    position: absolute; top: -8px; right: -8px; background: #ef4444; color: white;
    border: 2px solid #1f2937; border-radius: 50%; width: 22px; height: 22px;
    font-size: 10px; cursor: pointer; display: flex; justify-content: center; align-items: center;
}

/* === INTERFACE DOCK & UTILITY CONTROL ACTIONS === */
#bottom-interface-dock {
    position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 15px; z-index: 20;
}

#action-utility-bar {
    display: flex; gap: 10px; background: rgba(15, 23, 42, 0.9);
    padding: 8px 15px; border-radius: 10px; border: 1px solid #2d3748;
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}
.action-bar-btn {
    background: #2d3748; border: 1px solid #4a5568; color: #cbd5e1;
    padding: 8px 18px; font-size: 0.9rem; font-weight: bold; border-radius: 6px;
    cursor: pointer; transition: all 0.2s;
}
.action-bar-btn:hover { background: #4a5568; color: white; }
.action-bar-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Functional color updates mimicking standard reference layout configurations */
.active-uno { background: #d97706; border-color: #f59e0b; color: white; }
.active-uno:hover { background: #b45309; }
.callout-uno { background: #7c3aed; border-color: #8b5cf6; color: white; }
.callout-uno:hover { background: #6d28d9; }

#my-player-area { display: flex; flex-direction: column; align-items: center; }
.my-name-tag {
    background: #1f2937; padding: 4px 18px; border-radius: 15px;
    margin-bottom: -12px; z-index: 10; border: 2px solid #4b5563; font-weight: bold;
}
.active-turn .my-name-tag { border-color: #10b981; box-shadow: 0 0 15px rgba(16, 185, 129, 0.5); }
#hand {
    display: flex; justify-content: center; padding: 25px 20px 5px 20px;
    background: rgba(0,0,0,0.3); border-radius: 12px; border: 1px solid rgba(255,255,255,0.05);
}

/* === CARD ASSETS === */
.card { 
    width: 72px; height: 106px; border-radius: 8px; border: 3px solid white;
    display: inline-flex; justify-content: center; align-items: center; 
    font-weight: 900; font-size: 22px; margin-left: -18px; 
    box-shadow: -4px 4px 8px rgba(0,0,0,0.5); user-select: none;
    position: relative; overflow: hidden; background-color: #333;
    transition: transform 0.2s, margin 0.2s;
}
.card:first-child { margin-left: 0; }
.card::before {
    content: ''; position: absolute; width: 85%; height: 95%;
    background-color: white; border-radius: 50% / 60%; 
    transform: rotate(-25deg); z-index: 0;
}
.card-text { position: relative; z-index: 1; }

.playable { cursor: pointer; transform: translateY(-12px); box-shadow: 0 0 12px #fbbf24; z-index: 5; }
.playable:hover { transform: translateY(-25px); margin-left: 2px; margin-right: 15px; }

#center-board .card { margin: 0; box-shadow: 0 8px 16px rgba(0,0,0,0.6); }

.red { background: #e74c3c; } .red .card-text { color: #e74c3c; }
.blue { background: #3498db; } .blue .card-text { color: #3498db; }
.green { background: #2ecc71; } .green .card-text { color: #2ecc71; }
.yellow { background: #f1c40f; } .yellow .card-text { color: #d4ac0d; }
.black { background: #111; } .black .card-text { color: black; font-size: 26px; }

/* Color Picker Modal */
#color-picker-modal {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8); display: flex; justify-content: center; align-items: center; z-index: 2000;
}
.color-picker-box { background: #1f2937; padding: 30px; border-radius: 15px; text-align: center; border: 1px solid #374151; }
.color-btn { width: 65px; height: 65px; border-radius: 50%; border: 3px solid white; margin: 10px; cursor: pointer; transition: 0.1s; }
.color-btn:hover { transform: scale(1.1); }

/* === CHAT LOG DRAWER PANEL === */
#notebook-btn {
    position: absolute; bottom: 25px; right: 25px; background: #1f2937; border: 2px solid #4b5563;
    border-radius: 50%; width: 55px; height: 55px; display: flex; justify-content: center; align-items: center;
    cursor: pointer; box-shadow: 0 5px 12px rgba(0,0,0,0.5); z-index: 100;
}
#notebook-btn img { width: 26px; height: 26px; }
#side-panel {
    position: absolute; top: 0; right: -350px; width: 300px; height: 100%;
    background: rgba(17, 24, 39, 0.98); border-left: 2px solid #374151;
    display: flex; flex-direction: column; transition: right 0.3s ease; z-index: 99;
}
#side-panel.open { right: 0; }
#panel-header { padding: 18px; background: #1f2937; font-weight: bold; display: flex; justify-content: space-between; border-bottom: 1px solid #374151; }
#panel-header button { background: none; border: none; color: white; font-size: 1.1rem; cursor: pointer; }
#log-content { flex-grow: 1; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.log-entry { font-size: 0.85rem; padding: 6px 10px; border-radius: 6px; background: rgba(255,255,255,0.03); }
.log-action { color: #f59e0b; font-style: italic; }
.log-chat strong { color: #3b82f6; }
#chat-input-area { padding: 12px; background: #1f2937; border-top: 1px solid #374151; display: flex; gap: 8px; }
#chat-input-area input { flex-grow: 1; padding: 8px; border-radius: 5px; border: none; background: #111827; color: white; }
#chat-input-area button { padding: 8px 14px; background: #3b82f6; border: none; border-radius: 5px; color: white; font-weight: bold; cursor: pointer; }
