/* Grădinarul Inocent - Game Styles */
:root { --gi-green: #27ae60; --gi-gold: #f59e0b; --gi-red: #ef4444; }

/* Status Bar */
.status-bar { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 1.5rem; background: rgba(var(--card-bg-rgb,20,20,40),0.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border,rgba(255,255,255,0.08)); gap: 1rem; }
.status-bar.hidden { display: none; }
.room-pill, .timer-pill, .phase-badge { font-size: 0.8rem; font-weight: 700; padding: 0.3rem 0.85rem; border-radius: 999px; background: rgba(39,174,96,0.15); color: var(--gi-green); letter-spacing: 0.02em; white-space: nowrap; }
.phase-badge { background: rgba(255,255,255,0.07); color: var(--text-muted,#aaa); }

/* Loader */
.loader-container { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; gap: 1rem; color: var(--text-muted,#aaa); }
.premium-loader { width: 48px; height: 48px; border: 4px solid rgba(39,174,96,0.25); border-top-color: #27ae60; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* View container */
/* View container logic moved to global style.css */

/* Lobby */
.lobby-container { max-width: 960px;   }
.lobby-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.lobby-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr));  margin-bottom: 2rem; }
.room-card { background: var(--card-bg,rgba(255,255,255,0.05)); border: 1px solid var(--border,rgba(255,255,255,0.08)); border-radius: 16px;  cursor: pointer; transition: all 0.25s ease; }
.room-card:hover { transform: translateY(-3px); border-color: #27ae60; box-shadow: 0 8px 32px rgba(39,174,96,0.2); }
.room-card h3 { margin: 0 0 0.75rem; font-size: 1.1rem; }
.room-info { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.badge { font-size: 0.72rem; font-weight: 700; padding: 0.25rem 0.6rem; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; }
.badge-primary { background: rgba(39,174,96,0.2); color: #2ecc71; }
.badge-waiting { background: rgba(99,102,241,0.2); color: #818cf8; }
.badge-playing { background: rgba(39,174,96,0.2); color: #34d399; }
.room-stat { font-size: 0.8rem; color: var(--text-muted,#aaa); display: flex; align-items: center; gap: 0.3rem; }

/* Waiting Room */
.room-container { max-width: 600px;   }
.garden-waiting-icon { font-size: 4rem; display: block; text-align: center; margin-bottom: 0.5rem; animation: floatGarden 3s ease-in-out infinite; }
@keyframes floatGarden { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
.player-list-grid { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin: 1.25rem 0; }
.player-pill { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 1rem; border-radius: 999px; background: rgba(39,174,96,0.12); border: 1px solid rgba(39,174,96,0.25); font-size: 0.9rem; font-weight: 600; }
.room-info-box { display: inline-flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }

/* Game View */
.game-container, .game-container-inner { 
    max-width: 700px; 
    margin: 0 auto; 
    padding: 1.5rem 1.5rem 1.5rem; 
    width: 100%; 
}

@media (max-width: 600px) {
    .game-container, .game-container-inner {
        padding-top: 2rem !important;
    }
}

/* Problem Card */
.gi-problem-card { border-radius: 16px; background: linear-gradient(135deg, rgba(39,174,96,0.15), rgba(46,204,113,0.08)); border: 1.5px solid rgba(39,174,96,0.3); padding: 1rem 1.25rem; margin-bottom: 1rem; animation: fadeInUp 0.5s ease; }
.gi-problem-label { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: #2ecc71; margin: 0 0 0.35rem; opacity: 0.85; }
.gi-problem-text { font-size: 1.1rem; font-weight: 700; color: var(--text-main); margin: 0; line-height: 1.4; }

/* Role Card */
.gi-role-card { border-radius: 16px; padding: 1.25rem; margin-bottom: 1rem; animation: fadeInUp 0.4s ease; }
.gi-role-card.thief { background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(220,38,38,0.08)); border: 1.5px solid rgba(239,68,68,0.35); }
.gi-role-card.gardener { background: linear-gradient(135deg, rgba(39,174,96,0.15), rgba(46,204,113,0.08)); border: 1.5px solid rgba(39,174,96,0.3); }
.gi-role-label { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; margin: 0 0 0.4rem; opacity: 0.8; }
.gi-role-label.thief { color: #f87171; }
.gi-role-label.gardener { color: #2ecc71; }
.gi-role-name { font-size: 1.5rem; font-weight: 900; margin: 0 0 0.2rem; }
.gi-plantation-desc { font-size: 0.82rem; color: var(--text-muted,#aaa); margin: 0; }
.gi-role-hint { font-size: 0.8rem; color: var(--text-muted,#aaa); margin: 0.5rem 0 0; font-style: italic; }

/* Plantations list (Thief sees) */
.gi-plantations-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: 0.5rem; margin-bottom: 1rem; }
.gi-plantation-pill { padding: 0.6rem 0.9rem; border-radius: 12px; background: rgba(39,174,96,0.1); border: 1px solid rgba(39,174,96,0.2); font-size: 0.85rem; font-weight: 700; text-align: center; }
.gi-plantation-pill strong { display: block; color: #2ecc71; }
.gi-plantation-pill span { font-size: 0.72rem; color: var(--text-muted,#aaa); font-weight: 400; }

.gi-players-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.gi-player-btn {
    width: 120px;
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; padding: 0.75rem 0.5rem; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1.5px solid rgba(255,255,255,0.08); cursor: pointer; transition: all 0.2s ease; color: var(--text-main); font-size: 0.85rem; font-weight: 700; }
.gi-player-btn:hover:not(:disabled) { transform: translateY(-3px) scale(1.03); border-color: #27ae60; background: rgba(39,174,96,0.12); box-shadow: 0 6px 20px rgba(39,174,96,0.2); }
.gi-player-btn.is-me { border-style: dashed; opacity: 0.85; }
.gi-player-btn.selected { border-color: #ef4444; background: rgba(239,68,68,0.15); }
.gi-player-btn:disabled { opacity: 0.4; cursor: default; }
.gi-player-btn.voted-unconvincing { border-color: var(--gi-gold); background: rgba(245,158,11,0.12); }
.gi-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #27ae60, #1a8a48); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 900; color: #fff; }
.gi-player-btn.thief-marker .gi-avatar { background: linear-gradient(135deg, #ef4444, #dc2626); }
.gi-player-score { font-size: 0.7rem; color: var(--gi-gold); font-weight: 700; }

/* Ready bar */
.ready-bar { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; border-radius: 12px; background: rgba(39,174,96,0.08); border: 1px solid rgba(39,174,96,0.2); margin-bottom: 0.75rem; }
.ready-progress { flex: 1; height: 6px; background: rgba(255,255,255,0.08); border-radius: 999px; overflow: hidden; }
.ready-progress-fill { height: 100%; background: linear-gradient(90deg, #27ae60, #2ecc71); border-radius: 999px; transition: width 0.5s ease; }
.ready-text { font-size: 0.8rem; color: var(--text-muted,#aaa); white-space: nowrap; }

/* Round Progress */
.round-progress-bar { height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; margin-bottom: 1.25rem; overflow: hidden; }
.round-progress-fill { height: 100%; background: linear-gradient(90deg, #27ae60, #2ecc71); border-radius: 2px; transition: width 0.5s ease; }

/* Accusation result banner */
.gi-result-banner { padding: 0.85rem 1.1rem; border-radius: 12px; margin-bottom: 0.75rem; font-weight: 700; font-size: 0.9rem; animation: fadeInUp 0.4s ease; }
.gi-result-banner.success { background: rgba(39,174,96,0.15); border: 1.5px solid rgba(39,174,96,0.35); color: #2ecc71; }
.gi-result-banner.danger { background: rgba(239,68,68,0.15); border: 1.5px solid rgba(239,68,68,0.3); color: #f87171; }
.gi-result-banner.warning { background: rgba(245,158,11,0.15); border: 1.5px solid rgba(245,158,11,0.3); color: #fbbf24; }

/* Reveal Modal */
.result-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(8px); z-index: 5000; display: flex; align-items: center; justify-content: center; padding: 15px; animation: fadeInBg 0.3s ease; overflow: hidden; }
.result-modal-overlay.hidden { display: none; }
@keyframes fadeInBg { from{opacity:0} to{opacity:1} }
.result-modal-content { background: var(--card-bg,rgba(15,23,42,0.97)); border: 1.5px solid rgba(39,174,96,0.4); border-radius: 24px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 60px rgba(39,174,96,0.1); animation: modalShake 0.25s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes slideUpModal { from{opacity:0;transform:translateY(40px) scale(0.95)} to{opacity:1;transform:translateY(0) scale(1)} }
.result-modal-inner { padding: 1.75rem; }
.reveal-emoji { font-size: 3rem; text-align: center; display: block; margin-bottom: 0.5rem; animation: floatGarden 3s ease-in-out infinite; }
.reveal-title { font-size: 1.4rem; font-weight: 900; text-align: center; margin: 0 0 1.25rem; }
.reveal-section { margin-bottom: 1rem; }
.reveal-label { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted,#aaa); margin: 0 0 0.4rem; }
.reveal-value { font-size: 1rem; font-weight: 700; color: var(--text-main); }
.reveal-plantations { display: flex; flex-direction: column; gap: 0.4rem; }
.reveal-plant-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.7rem; border-radius: 8px; background: rgba(255,255,255,0.04); font-size: 0.85rem; }
.reveal-plant-row.is-thief { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.25); }
.reveal-plant-name { font-weight: 700; flex: 1; }
.reveal-plant-role { font-size: 0.72rem; color: var(--text-muted,#aaa); }
.reveal-scores { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.score-row { display: flex; align-items: center; justify-content: space-between; padding: 0.45rem 0.7rem; border-radius: 8px; background: rgba(255,255,255,0.04); font-size: 0.88rem; }
.score-row.positive { border-left: 3px solid #27ae60; }
.score-row.negative { border-left: 3px solid #ef4444; }
.score-change { font-weight: 800; }
.score-change.pos { color: #2ecc71; }
.score-change.neg { color: #f87171; }
.continue-btn { display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.9rem 2rem; border-radius: 12px; font-size: 1rem; font-weight: 800; background: linear-gradient(135deg, #27ae60, #1a8a48); color: #fff; border: none; cursor: pointer; transition: all 0.25s ease; box-shadow: 0 4px 24px rgba(39,174,96,0.4); width: 100%; justify-content: center; margin-top: 1rem; }
.continue-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(39,174,96,0.55); }
.continue-btn:disabled { opacity: 0.5; cursor: default; transform: none; }

/* Final Screen */
.results-container { max-width: 640px;   }
.results-header { text-align: center; margin-bottom: 2rem; }
.results-finale { font-size: 3.5rem; display: block; text-align: center; margin-bottom: 0.5rem; animation: floatGarden 3s ease-in-out infinite; }
.final-scores { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.5rem; }
.final-score-row { display: flex; align-items: center; gap: 1rem; padding: 0.9rem 1.1rem; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); transition: background 0.2s; }
.final-score-row:nth-child(1) { border-color: rgba(245,158,11,0.4); background: rgba(245,158,11,0.08); }
.final-score-row:nth-child(2) { border-color: rgba(168,168,168,0.3); background: rgba(168,168,168,0.06); }
.final-score-row:nth-child(3) { border-color: rgba(180,100,0,0.3); background: rgba(180,100,0,0.06); }
.final-rank { min-width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.82rem; flex-shrink: 0; }
.final-username { flex: 1; font-weight: 700; }
.final-pts { font-size: 1rem; font-weight: 900; color: var(--gi-gold); }
.history-section { margin-bottom: 1.5rem; }
.history-item { display: flex; gap: 1rem; align-items: flex-start; padding: 0.9rem 1.1rem; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); font-size: 0.85rem; margin-bottom: 0.5rem; }
.history-round { min-width: 34px; height: 34px; border-radius: 50%; background: rgba(39,174,96,0.18); color: #2ecc71; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.8rem; flex-shrink: 0; }
.history-content { flex: 1; line-height: 1.5; }
.history-problem { font-weight: 700; color: var(--text-main); margin-bottom: 0.2rem; }
.history-detail { color: var(--text-muted,#aaa); }

/* Emoji bar */
#game-emoji-bar { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); z-index: 2000; width: 100%; max-width: 500px; padding: 0 1rem; pointer-events: none; }
#game-emoji-bar .emoji-reactions-bar { pointer-events: auto; background: rgba(15,23,42,0.8); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.1); border-radius: 2rem; padding: 0.5rem 1rem; box-shadow: 0 10px 30px rgba(0,0,0,0.4); }

/* Toast */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast { padding: 0.75rem 1.25rem; border-radius: 12px; font-size: 0.9rem; font-weight: 600; color: #fff; backdrop-filter: blur(12px); animation: fadeInUp 0.3s ease; transition: opacity 0.3s, transform 0.3s; box-shadow: 0 4px 24px rgba(0,0,0,0.3); }
.toast-error { background: rgba(239,68,68,0.85); border: 1px solid rgba(239,68,68,0.5); }
.toast-info { background: rgba(39,174,96,0.85); border: 1px solid rgba(39,174,96,0.4); }
.toast-success { background: rgba(39,174,96,0.85); border: 1px solid rgba(39,174,96,0.4); }

/* Animations */
@keyframes fadeInUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
.fade-in { animation: fadeInUp 0.4s ease; }

/* Phase specific */
.phase-banner { text-align: center; padding: 0.5rem 1rem; border-radius: 999px; font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.75rem; display: inline-block; }
.phase-banner.playing { background: rgba(39,174,96,0.2); color: #2ecc71; }
.phase-banner.theft { background: rgba(239,68,68,0.2); color: #f87171; }
.phase-banner.vote { background: rgba(245,158,11,0.2); color: #fbbf24; }
.phase-center { 
    text-align: center; 
    margin-bottom: 1rem; 
    margin-top: 0.5rem; 
}

@media (max-width: 600px) {
    .phase-center {
        margin-top: 1rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .gi-players-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; }
    .gi-players-grid .gi-player-btn { width: 100px; }
    .gi-plantations-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; }
    .gi-plantations-list .gi-plantation-pill { width: 120px; }
    .lobby-container, .room-container, .game-container, .results-container {  }
    .result-modal-inner { padding: 1.25rem; }
}
@media (pointer: coarse) { html, body { overscroll-behavior: auto; } }

/* 3D Flip Card for Roles */
.role-reveal-container {
    perspective: 1000px;
    width: 100%;
    max-width: 320px;
    height: 150px;
    margin: 1.25rem auto;
    cursor: pointer;
}
.role-card-flip {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}
.role-card-flip.flipped {
    transform: rotateY(180deg);
}
.card-front, .card-back {
    position: absolute;
    inset: 0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
.card-front {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.12), rgba(46, 204, 113, 0.08));
    border: 2px dashed rgba(39, 174, 96, 0.35);
    color: var(--text-main);
}
.card-back {
    transform: rotateY(180deg);
}

.gi-role-reveal-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(46, 204, 113, 0.3);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    max-width: 320px;
    margin: 1.5rem auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.gi-role-reveal-btn:hover {
    background: rgba(46, 204, 113, 0.08);
    border-color: rgba(46, 204, 113, 0.6);
    transform: translateY(-2px);
}
.gi-role-reveal-btn .reveal-btn-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}
.gi-role-reveal-btn .reveal-btn-sub {
    font-size: 0.85rem;
    color: var(--text-muted, #aaa);
}


/* Tabs Header */
.game-tabs-header {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 1rem 0.5rem;
    background: rgba(var(--card-bg-rgb,20,20,40), 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    position: sticky;
    top: 52px; /* Under status bar */
    z-index: 90;
}
.game-tabs-header.hidden { display: none; }

.game-tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.4rem 0.8rem;
    background: transparent;
    border: none;
    color: var(--text-muted, #aaa);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 10px;
    min-width: 70px;
}
.game-tab-btn i { font-size: 1rem; }
.game-tab-btn span { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }

.game-tab-btn.active {
    background: rgba(39,174,96,0.15);
    color: #2ecc71;
    box-shadow: inset 0 0 10px rgba(39,174,96,0.1);
}
.game-tab-btn:hover:not(.active) {
    background: var(--glass-hover); color: var(--text-main);
}

@media (max-width: 480px) {
    .game-tabs-header {
        top: 48px;
        padding: 0.35rem 0.5rem;
    }
    .game-tab-btn {
        min-width: 60px;
        padding: 0.35rem 0.4rem;
    }
}

