#qwirkle-tracker-app { max-width: 600px; margin: 0 auto; position: relative; background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); overflow: hidden; }
.qt-hidden { display: none !important; }

/* Global Animations */
.qt-animate-fade { animation: qtFadeInUp 0.5s ease-out forwards; }
@keyframes qtFadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}
.qt-animate-pop { animation: qtPopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
@keyframes qtPopIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Forms & Setup */
#qt-add-player-form { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
#qt-add-player-form input { flex: 1; min-width: 120px; padding: 10px; border: 1px solid #ccc; border-radius: 4px; }
#qt-add-player-form button, .qt-submit-area button, #qt-btn-start-game, #qt-btn-resume, #qt-btn-new-game, #qt-btn-reset-session { padding: 12px 20px; cursor: pointer; border-radius: 4px; transition: all 0.2s ease; }
.qt-setup-actions { display: flex; gap: 10px; margin-top: 15px; }
#qt-setup-player-list { list-style: none; padding: 0; margin-bottom: 20px; }
#qt-setup-player-list li { display: flex; align-items: center; justify-content: space-between; padding: 12px; background: #fdfdfd; margin-bottom: 8px; border: 1px solid #eee; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); flex-wrap: wrap; gap: 10px; }
.qt-setup-details { flex: 1; min-width: 150px; font-size: 1.1em; }
.qt-setup-inputs { display: flex; gap: 10px; align-items: center; }
.qt-setup-inputs input { width: 80px; padding: 8px; text-align: center; border: 1px solid #ccc; border-radius: 4px; }
.qt-btn-remove { background: #e74c3c; color: white; border: none; border-radius: 4px; cursor: pointer; padding: 8px 14px; font-weight: bold; }

/* NEW Navigation Grid */
.qt-nav-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 25px; background: #f8f9fa; padding: 8px; border-radius: 8px; border: 1px solid #eee; }
.qt-nav-grid button { padding: 10px 5px; font-size: 0.9em; font-weight: bold; border-radius: 6px; border: none; cursor: pointer; transition: transform 0.1s ease, filter 0.2s; box-shadow: 0 2px 0px rgba(0,0,0,0.1); }
.qt-nav-grid button:active { transform: translateY(2px); box-shadow: 0 0px 0px rgba(0,0,0,0); }
#qt-btn-cancel-game { background: #e74c3c; color: #fff; }
#qt-btn-undo { background: #e67e22; color: #fff; }
#qt-btn-review { background: #34495e; color: #fff; }
#qt-btn-voice { background: #2980b9; color: #fff; font-size: 1.2em; padding: 5px; }
#qt-btn-voice.voice-off { background: #95a5a6; filter: grayscale(100%); }

/* Massive Current Player Banner */
.qt-current-player-banner { text-align: center; margin-bottom: 30px; background: #2fa4a4; color: #fff; padding: 25px 15px; border-radius: 12px; box-shadow: 0 8px 20px rgba(44,62,80,0.3); }
.qt-current-player-banner p { margin: 0 0 5px 0; font-size: 1rem; opacity: 0.7; text-transform: uppercase; letter-spacing: 3px; font-weight: bold; }
#qt-current-player-name { font-size: 3.5rem; font-weight: 900; display: block; line-height: 1.1; text-shadow: 2px 2px 4px rgba(0,0,0,0.4); }

/* Scoreboard */
#qt-scoreboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 15px; margin-bottom: 30px; }
.qt-player-card { border: 2px solid #eee; padding: 15px; text-align: center; border-radius: 12px; opacity: 0.6; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); background: #fafafa; }
.qt-player-card h4 { margin: 0 0 10px 0; font-size: 1.1em; display: flex; flex-direction: column; gap: 4px; color: #555; }
.qt-wins-badge { font-size: 0.8em; color: #888; font-weight: normal; }
.qt-player-card .qt-total { font-size: 1.8em; font-weight: bold; color: #333; }
.qt-player-card.active-turn { border-color: #2c3e50; background: #fff; opacity: 1; transform: scale(1.08); box-shadow: 0 6px 15px rgba(0,0,0,0.1); }
.qt-player-card.active-turn h4 { color: #2c3e50; }
.qt-player-card.active-turn .qt-total { color: #2c3e50; }

/* Action Area */
.qt-action-area { background: #f8f9fa; padding: 25px; border-radius: 12px; border: 1px solid #eee; }
.qt-action-area input[type="number"] { width: 100%; box-sizing: border-box; font-size: 1.5em; padding: 15px; margin-bottom: 20px; text-align: center; border: 2px solid #ddd; border-radius: 8px; transition: border-color 0.2s; }
.qt-action-area input[type="number"]:focus { outline: none; border-color: #2c3e50; }

/* ENHANCED QUICK ACTIONS (CHUNKY TILES) */
.qt-quick-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 15px; margin-bottom: 25px; }
.qt-btn-quick { padding: 20px 10px; cursor: pointer; border: none; border-radius: 12px; font-size: 1.2em; transition: all 0.1s ease; position: relative; top: 0; box-shadow: 0 6px 0px rgba(0,0,0,0.25); text-transform: uppercase; }
.qt-btn-quick:active { top: 6px; box-shadow: 0 0px 0px rgba(0,0,0,0); }

.qt-btn-plus6 { background: #3498db; color: white; font-weight: 800; }
.qt-qwirkle-btn { 
    background: linear-gradient(135deg, #e74c3c, #f39c12, #f1c40f, #2ecc71, #3498db, #9b59b6); 
    background-size: 200% 200%;
    color: white; 
    font-weight: 900; 
    letter-spacing: 1.5px; 
    text-shadow: 1px 1px 3px rgba(0,0,0,0.6); 
    animation: qtRainbowFlow 4s ease infinite;
}
@keyframes qtRainbowFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.qt-submit-area { display: flex; flex-direction: column; gap: 15px; }
.qt-final-go-label { font-weight: bold; color: #e74c3c; display: flex; align-items: center; gap: 8px; font-size: 1.1em; }

/* Modal */
.qt-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); display: flex; align-items: center; justify-content: center; z-index: 9999; backdrop-filter: blur(3px); }
.qt-modal-content { background: #fff; color: #333; padding: 30px; border-radius: 12px; max-width: 90%; max-height: 90vh; overflow-y: auto; width: 500px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.qt-modal-content table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.qt-modal-content th { background: #f4f4f4; }
.qt-modal-content th, .qt-modal-content td { border: 1px solid #ddd; padding: 10px; text-align: center; }
#qt-btn-close-review { width: 100%; padding: 15px; background: #2c3e50; color: white; border: none; border-radius: 6px; font-weight: bold; font-size: 1.1em; cursor: pointer; }

/* Results */
#qt-podium { margin-bottom: 30px; font-size: 1.2em; text-align: center; }
.qt-winner { font-size: 2rem; font-weight: bold; margin-bottom: 10px; color: #f39c12; animation: qtPopIn 0.6s ease; }
.qt-runner-up { color: #666; font-size: 1.2em; margin-bottom: 15px; }
#qt-session-stats { margin-top: 20px; font-size: 0.9em; color: #666; border-top: 1px solid #eee; padding-top: 15px; display: flex; justify-content: space-between; align-items: center; }
#qt-btn-reset-session { font-size: 0.8em; padding: 5px 10px; background: #eee; border: 1px solid #ccc; color: #333; }

/* CINEMATIC FULL SCREEN OVERLAY */
#qt-fullscreen-announcement { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: center; z-index: 999999; }
.qt-bg-black { background-color: #000; }
.qt-bg-teal { background-color: rgb(46, 164, 164); }
.qt-bg-red { background-color: #e14d43; }
#qt-announcement-text { color: #fff; font-size: clamp(2.5rem, 8vw, 5rem); font-weight: 900; line-height: 1.2; text-align: center; text-transform: uppercase; text-shadow: 0 0 20px rgba(255,255,255,0.2); padding: 20px; }
.qt-cinematic-fade { animation: qtCinematic 3s forwards; }
@keyframes qtCinematic { 0% { opacity: 0; transform: scale(0.8); } 15% { opacity: 1; transform: scale(1.05); } 30% { opacity: 1; transform: scale(1); } 80% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.1); } }

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .qt-setup-actions, 
    #qt-add-player-form {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    .qt-setup-actions button,
    #qt-add-player-form input,
    #qt-add-player-form button {
        width: 100%;
        margin-bottom: 4px;
        box-sizing: border-box;
    }
    .qt-quick-actions {
        grid-template-columns: 1fr; /* Stacks quick actions on very small screens */
    }
}