/* public/modules/uno/style.css */

:root {
    --card-width: 90px;
    --card-height: 130px;
}

/* =========================================
   ESTRUTURA GERAL (SEM SCROLL NO BODY)
   ========================================= */
.hub-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.screen {
    display: none;
    width: 100%;
    height: 91dvh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease;
    padding: 10px;
    box-sizing: border-box;
}

.screen.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Listas internas também sem barra */
.room-list, #lobby-player-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    max-height: 150px;
    
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.room-list::-webkit-scrollbar, 
#lobby-player-list::-webkit-scrollbar { 
    display: none; 
}

.mode-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0px;
    text-align: left;
}

.section-header {
    display: flex; align-items: center; gap: 10px;
    font-weight: bold; color: white; font-size: 1.1rem;
}

.input-group { display: grid; grid-template-columns: 1fr 1fr; text-align: left; gap: 10px; }
.input-group label { display: block; margin-bottom: 5px; color: #aaa; font-size: 0.9rem; }
.input-group input, .input-group select {
    width: 100%; padding: 12px;
    background: #151520; border: 1px solid #333; border-radius: 8px;
    color: white; outline: none; box-sizing: border-box;
}
.input-group input:focus { border-color: var(--neon-blue); }
.control-row { display: flex; gap: 10px; align-items: center; }
.room-item {
    background: rgba(0,0,0,0.2); margin-bottom: 5px; padding: 8px;
    border-radius: 4px; display: flex; justify-content: space-between; align-items: center;
}
#lobby-player-list li { padding: 8px; border-bottom: 1px solid rgba(255,255,255,0.05); color: #ccc; }

/* =========================================
   ÁREA DE JOGO
   ========================================= */
.game-layout {
    justify-content: space-between; padding: 10px;
    background: radial-gradient(circle at center, #1b2735 0%, #090a0f 100%);
}
.top-bar { width: 100%; }

.players-row {
    display: flex; gap: 15px; padding: 10px;
    overflow-x: auto; width: 100%; justify-content: flex-start;
    min-height: 110px; scrollbar-width: none;
}
.players-row::-webkit-scrollbar { display: none; }

.player-avatar {
    background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px; padding: 10px; min-width: 90px; text-align: center;
    position: relative; flex-shrink: 0;
}
.player-avatar.active-turn {
    border-color: var(--neon-green); background: rgba(0, 255, 157, 0.1);
    box-shadow: 0 0 15px rgba(0,255,157,0.3); transform: scale(1.05);
}
.p-name { font-weight: bold; font-size: 0.9rem; margin-bottom: 5px; }
.p-cards { font-size: 0.9rem; color: #aaa; }

.table-area {
    flex: 1; display: flex; flex-direction: column;
    justify-content: center; align-items: center; gap: 20px;
    width: 100%; min-height: 215px;
}
.turn-indicator {
    background: rgba(0,0,0,0.5); padding: 5px 20px;
    border-radius: 20px; font-size: 1.2rem; font-weight: bold; color: white;
}
.decks-container { display: flex; gap: 30px; }

.card-back {
    width: var(--card-width); height: var(--card-height);
    background: linear-gradient(135deg, #333, #000);
    border: 2px solid #555; border-radius: 8px;
    display: flex; justify-content: center; align-items: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5); cursor: pointer;
}
.card-back::after { content: 'UNO'; transform: rotate(-45deg); font-weight: bold; color: #555; }

/* =========================================
   CARTAS (RETO E SEGURO)
   ========================================= */
.card-item {
    width: var(--card-width); height: var(--card-height);
    background: white; border-radius: 8px; position: relative;
    cursor: pointer; box-shadow: 2px 2px 6px rgba(0,0,0,0.4);
    padding: 4px; box-sizing: border-box; flex-shrink: 0;
    transition: transform 0.2s, margin 0.2s;
}
.card-item.red .card-inner { background: #ff5555; }
.card-item.blue .card-inner { background: #5555ff; }
.card-item.green .card-inner { background: #55aa55; }
.card-item.yellow .card-inner { background: #ffaa00; }
.card-item.black .card-inner { background: #222; border: 2px solid #555; }

.card-inner {
    width: 100%; height: 100%; border-radius: 4px;
    position: relative; overflow: hidden;
}
.card-value {
    transform: none !important; writing-mode: horizontal-tb !important;
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: center; text-align: center;
    color: white; font-weight: 900; text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    white-space: normal; word-break: break-word; overflow: hidden;
    line-height: 1.0; padding: 2px;
}

/* =========================================
   MÃO DO JOGADOR
   ========================================= */
.bottom-section { width: 100%; max-width: 100vw; z-index: 10; padding-bottom: 10px; }

.hand-container {
    display: flex; width: 100%; height: 215px;
    overflow-x: auto; overflow-y: hidden;
    justify-content: flex-start; align-items: center;
    padding: 0 15px; box-sizing: border-box;
    scrollbar-width: none;
}
.hand-container::-webkit-scrollbar { display: none; }

#my-hand {
    display: flex; align-items: center; margin: 0 auto; width: max-content; padding: 20px 0;
}
#my-hand .card-item { margin-left: -40px; box-shadow: -2px 0 5px rgba(0,0,0,0.3); }
#my-hand .card-item:first-child { margin-left: 0; }
#my-hand .card-item:hover {
    transform: translateY(-30px) scale(1.1) !important;
    z-index: 1000 !important; margin-right: 30px;
}
#my-hand[style*="pointer-events: none"] .card-item {
    filter: grayscale(0.8) brightness(0.6); opacity: 0.7;
}

/* =========================================
   MODAIS E UTILITÁRIOS
   ========================================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); display: none;
    justify-content: center; align-items: center; z-index: 5000;
}
.modal-content {
    background: #1a1a2e; border: 2px solid var(--neon-blue);
    padding: 30px; border-radius: 15px; text-align: center;
    max-width: 90%; width: 400px;
}
.color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.btn-color {
    height: 80px; border-radius: 10px; border: none; cursor: pointer;
    transition: 0.2s; box-shadow: 0 4px 0 rgba(0,0,0,0.3);
}
.btn-color.red { background: #ff5555; }
.btn-color.blue { background: #5555ff; }
.btn-color.green { background: #55aa55; }
.btn-color.yellow { background: #ffaa00; }
#victory-modal .modal-content { border-color: var(--neon-yellow); background: linear-gradient(135deg, #1a1a1a, #2a2a00); }
#error-modal .modal-content { border-color: var(--neon-red); }
#game-message {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0, 0, 0, 0.9); border: 2px solid rgba(255, 255, 255, 0.5);
    padding: 15px 30px; border-radius: 10px; font-size: 1.5rem; font-weight: bold;
    color: white; opacity: 0; transition: 0.3s; z-index: 2000; pointer-events: none;
}

@media (max-width: 600px) {
    :root { --card-width: 60px; --card-height: 90px; }
    .hand-container { height: 140px; }
    #my-hand .card-item { margin-left: -25px; }
    #my-hand .card-item:hover { transform: translateY(-25px) scale(1.15) !important; margin-right: 15px; }
}

