.btn-back-hub {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
    z-index: 100;
}

.btn-back-hub:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-5px);
}

:root {
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 10px;
}

.app-container {
    width: 100%;
    max-width: 500px;
    background: var(--bg-color);
    position: relative;
    padding: 10px;
}

/* Screen Management */
.screen {
    display: none;
    flex-direction: column;
    height: 100%;
    animation: fadeIn 0.3s ease-out;
}

.screen.active {
    display: flex;
}

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

/* Typography & Headers */
.main-header {
    margin-bottom: 25px;
    padding-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

.app-logo {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -1px;
    line-height: 1;
}

.title span {
    color: var(--text-main);
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 8px;
    text-align: center;
}

/* Buttons */
.btn {
    font-family: inherit;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow-md); }

.btn-success { background: var(--success-color); color: white; }
.btn-danger { background: var(--danger-color); color: white; }
.btn-secondary { background: var(--secondary-color); color: white; }
.btn-outline { background: transparent; border: 2px solid var(--border-color); color: var(--text-muted); }

.btn-block { width: 100%; }
.btn-lg { padding: 18px 36px; font-size: 1.25rem; }

.mt-1 { margin-top: 1rem; }

/* Cards & Containers */
.rules-card, .setup-card, .transition-card, .summary-card, .winner-card {
    background: var(--surface-color);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
}

.rules-card h3 { margin-bottom: 12px; font-size: 1.2rem; }
.rules-card ul { padding-left: 20px; color: var(--text-muted); }
.rules-card li { margin-bottom: 8px; }

/* Form Groups */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-group select {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: #f1f5f9;
    font-family: inherit;
    font-size: 1rem;
}

/* Transition Screen */
.transition-card {
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.round-indicator {
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.team-announcement {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 5px;
}

.instructions {
    color: var(--text-muted);
    margin-bottom: 30px;
}

.scoreboard-mini {
    margin-top: auto;
}

.mini-scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 12px;
}

.mini-score-item {
    background: rgba(255, 255, 255, 0.5);
    padding: 12px;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--border-color);
}

.mini-score-item .team { font-size: 0.8rem; color: var(--text-muted); }
.mini-score-item .points { font-size: 1.2rem; font-weight: 700; }

/* Game Screen */
/* Game Screen Controls */
.game-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 5px;
}

.logo-mini-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--primary-color);
    transition: transform 0.2s;
}

.logo-mini-btn:hover {
    transform: scale(1.1);
}

.top-bar-actions {
    display: flex;
    gap: 10px;
}

.icon-btn {
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

/* Overlay System */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    border-radius: var(--radius-lg);
    animation: fadeIn 0.2s ease-out;
}

.overlay.active {
    display: flex;
}

.overlay-content {
    background: var(--surface-color);
    padding: 30px;
    border-radius: var(--radius-lg);
    text-align: center;
    width: 80%;
}

.overlay-content h2 {
    margin-bottom: 20px;
    color: var(--text-main);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 5px;
}

.current-team-label {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-color);
    display: block;
}

.timer-display {
    font-size: 2rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.turn-stats {
    display: flex;
    gap: 15px;
}

.stat-item { text-align: right; }
.stat-label { font-size: 0.7rem; text-transform: uppercase; color: var(--text-muted); display: block; }
.stat-value { font-size: 1.2rem; font-weight: 800; }
.stat-value.correct { color: var(--success-color); }
.stat-value.taboo { color: var(--danger-color); }

/* The Card */
.card-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

.card {
    width: 100%;
    aspect-ratio: 3/4;
    max-height: 450px;
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px 20px;
    position: relative;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease;
}

.card-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.main-word {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.divider {
    width: 60px;
    height: 4px;
    background: #f1f5f9;
    border-radius: 2px;
    margin-bottom: 30px;
}

.forbidden-words {
    list-style: none;
    text-align: center;
    width: 100%;
}

.forbidden-words li {
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text-main);
    opacity: 0.8;
}

/* Custom Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--surface-color);
    padding: 30px;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-content h3 {
    margin-bottom: 15px;
    color: var(--text-main);
    font-size: 1.5rem;
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 25px;
    line-height: 1.5;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Actions */
.game-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: 
        "correct taboo"
        "pass pass";
    gap: 12px;
    margin-top: 20px;
    padding-bottom: 10px;
}

#btn-correct { grid-area: correct; height: 80px; font-size: 1.2rem; }
#btn-taboo { grid-area: taboo; height: 80px; font-size: 1.2rem; }
#btn-pass { grid-area: pass; height: 50px; }

/* Summary & Winner */
.summary-stats, .final-scoreboard {
    margin: 24px 0;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.summary-item.total {
    border-bottom: none;
    font-weight: 800;
    font-size: 1.2rem;
    margin-top: 10px;
}

.correct { color: var(--success-color); }
.taboo { color: var(--danger-color); }

.winner-card {
    text-align: center;
}

.trophy {
    font-size: 5rem;
    margin-bottom: 20px;
}

.final-score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8fafc;
    border-radius: var(--radius-md);
    margin-bottom: 10px;
}

.final-score-item.winner {
    background: #fef3c7;
    border: 2px solid var(--warning-color);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--surface-color);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    width: 90%;
    max-width: 400px;
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { border-left: 4px solid var(--danger-color); }

/* Responsive adjustments */
@media (max-width: 400px) {
    .title { font-size: 2.2rem; }
    .main-word { font-size: 1.8rem; }
    .forbidden-words li { font-size: 1.1rem; }
    #btn-correct, #btn-taboo { height: 70px; }
}
