body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a1a;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

#app {
    background: #ecf0f1;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    width: 90%;
    max-width: 450px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.screen { display: none; }
.screen.active { display: block; }

.title-area { margin-bottom: 15px; color: #111; }
.title-area h1 { font-size: 2.8rem; margin: 0; color: #111; }
.main-cat-icon { font-size: 3rem; color: #111; margin-bottom: 10px; }
.subtitle { margin: 0; font-size: 1rem; color: #555; font-weight: bold; }

.brief-rules {
    background: linear-gradient(135deg, #ffffff 0%, #f4f7f6 100%);
    border-left: 5px solid #3498db;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    text-align: left;
    color: #333;
    font-size: 0.95rem;
    line-height: 1.5;
}

.score-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.score-badge.success { background-color: #27ae60; }
.score-badge.danger { background-color: #c0392b; }
.score-badge.secondary { background-color: #95a5a6; }

.settings-container { background: white; padding: 20px; border-radius: 8px; margin-bottom: 20px; border: 1px solid #ccc; }
.input-group { margin: 15px 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.stylish-label { font-weight: 700; color: #111; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.5px; }
.input-wrap { display: flex; align-items: center; gap: 8px; }
.unit { color: #7f8c8d; font-weight: bold; }
.divider { border: 0; height: 1px; background: #eee; margin: 15px 0; }

input[type="number"], input[type="text"], .stylish-input {
    padding: 10px;
    font-size: 1.1rem;
    border: 2px solid #333;
    border-radius: 8px;
    background-color: #fff;
    color: #111;
    font-weight: bold;
    outline: none;
    transition: 0.3s;
}
input[type="number"]:focus, input[type="text"]:focus, .stylish-input:focus { border-color: #f39c12; box-shadow: 0 0 8px rgba(243, 156, 18, 0.3); }
.small-input { width: 50px !important; padding: 6px !important; }
.small-select { width: 110px !important; padding: 6px !important; font-size: 0.95rem; }

.switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: .4s; }
input:checked + .slider { background-color: #f39c12; }
input:checked + .slider:before { transform: translateX(22px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

.stats-panel { background: white; border-radius: 8px; padding: 20px; margin-bottom: 20px; border: 1px solid #ccc; }
.team-totals { display: flex; justify-content: space-around; border-bottom: 2px solid #ecf0f1; padding-bottom: 15px; margin-bottom: 15px; }
.team-stat h3 { margin: 0 0 10px 0; }
.big-score { font-size: 3rem; font-weight: bold; }
.t1-label { color: #3498db; } 
.t2-label { color: #f39c12; } 
.t1-score { color: #2980b9; }
.t2-score { color: #e67e22; }

.history-section h3 { margin: 0 0 10px 0; color: #7f8c8d; font-size: 1.1rem; }
.history-grid-header, .history-item { display: grid; grid-template-columns: 1fr 35px 20px 35px 35px; align-items: center; }
.history-grid-header { padding: 0 15px 5px 15px; font-size: 0.8rem; color: #7f8c8d; font-weight: bold; text-transform: uppercase; }
.hg-round { text-align: left; }
.hg-t1, .hg-t2, .hg-blank { text-align: center; }
.history-container { max-height: 120px; overflow-y: auto; background: #f9f9f9; border-radius: 6px; padding: 8px; border: 1px solid #e0e0e0; }
#score-history-list { list-style: none; padding: 0; margin: 0; }
.history-item { background: #fff; padding: 8px 15px; border-radius: 6px; margin-bottom: 5px; border: 1px solid #ddd; }
.hist-round { font-weight: bold; color: #555; font-size: 0.95rem; }
.hist-score { font-size: 1.1rem; font-weight: bold; }
.hist-vs { color: #ccc; font-size: 0.9rem; }
.history-placeholder { color: #aaa; text-align: center; justify-content: center !important; display: flex; padding: 10px; }

.details-btn {
    background: rgba(52, 152, 219, 0.1);
    border: none;
    color: #3498db;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    margin-left: 5px;
}
.details-btn:hover { background: rgba(52, 152, 219, 0.2); color: #2980b9; transform: scale(1.1); }

.turn-header { display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.turn-header h2 { color: #111; font-size: 2rem; margin: 0; }
.settings-row { background: white; padding: 10px 15px; border-radius: 8px; margin-bottom: 15px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 15px; border: 1px solid #ccc;}
.ai-row { padding: 5px 15px; margin-top: -10px; }
.setting-item { display: flex; align-items: center; gap: 8px; }
.action-row { display: flex; justify-content: space-between; gap: 10px; }
.action-row button { flex: 1; margin: 0; }

.how-to-play-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 15px;
    font-size: 0.95rem;
    color: #3498db;
    cursor: pointer;
    font-weight: bold;
    padding: 8px 15px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 20px;
    transition: 0.2s;
}
.how-to-play-link:hover { background: rgba(52, 152, 219, 0.2); color: #2980b9; }

.reset-memory-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 15px;
    font-size: 0.95rem;
    color: #e74c3c;
    cursor: pointer;
    font-weight: bold;
    padding: 8px 15px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 20px;
    transition: 0.2s;
}
.reset-memory-link:hover { background: rgba(231, 76, 60, 0.2); color: #c0392b; }

.taboo-card { background: white; padding: 30px 20px; border-radius: 8px; border: 2px solid #111; margin: 20px 0; position: relative; box-shadow: 0 4px 8px rgba(0,0,0,0.2); min-height: 180px; display: flex; flex-direction: column; justify-content: center; }
#loading-overlay { font-size: 1.5rem; color: #f39c12; font-weight: bold; text-align: center; }
#target-word { font-size: 2.2rem; color: #e67e22; margin: 0 0 10px 0; text-transform: uppercase; position: relative;}
#taboo-words { list-style-type: none; padding: 0; color: #111; font-size: 1.3rem; font-weight: bold; }
#taboo-words li { margin: 8px 0; }

.header { display: flex; justify-content: space-between; font-size: 1.5rem; font-weight: bold; margin-bottom: 10px; align-items: center; color: #111;}
.timer-wrap { color: #f39c12; }
.score-wrap { font-size: 1.2rem; }
.controls { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 15px; }
.utility-controls { margin-top: 15px; border-top: 1px solid #ccc; padding-top: 15px; display: flex; justify-content: center; gap: 10px; }

button { padding: 12px 15px; font-size: 1rem; border: none; border-radius: 6px; cursor: pointer; color: white; background-color: #333; font-weight: bold; transition: 0.2s; }
button:hover:not(:disabled) { filter: brightness(120%); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-large { width: 100%; font-size: 1.2rem; padding: 15px; }
.btn-success { background-color: #27ae60; }
.btn-warning { background-color: #f39c12; color: #fff; }
.btn-danger { background-color: #c0392b; }
.btn-secondary { background-color: #95a5a6; }

/* Modals */
.modal {
    display: none;
    position: absolute;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px);
    align-items: center;
    justify-content: center;
}
.modal.active { display: flex; }

.modal-content {
    background-color: #fefefe;
    padding: 25px;
    border-radius: 12px;
    width: 85%;
    max-width: 380px;
    text-align: left;
    position: relative;
    border: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.modal-content h2 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.6rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 15px;
}

.close-btn {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: 0.2s;
}
.close-btn:hover { color: #e74c3c; transform: scale(1.1); }

/* Rules Modal Specific */
.aesthetic-list { list-style: none; padding: 0; margin: 0; }
.aesthetic-list li {
    background: #f8f9fa; margin-bottom: 10px; padding: 12px 15px;
    border-radius: 8px; border-left: 4px solid #f39c12;
    font-size: 0.95rem; color: #444; line-height: 1.4; box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

/* Round Details Modal Specific */
.details-teams-container { display: flex; gap: 15px; margin-top: 15px; }
.details-team { flex: 1; background: #f8f9fa; padding: 12px; border-radius: 8px; border: 1px solid #eee; }
.details-team h3 { margin-top: 0; font-size: 1.1rem; text-align: center; margin-bottom: 10px; border-bottom: 2px solid #ddd; padding-bottom: 5px; }
.details-list { list-style: none; padding: 0; margin: 0; max-height: 250px; overflow-y: auto; }
.details-list li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid #eee; font-size: 0.95rem; font-weight: bold; color: #444; }
.details-list li:last-child { border-bottom: none; }
.status-icon { font-size: 1.1rem; }
.status-icon.correct { color: #27ae60; }
.status-icon.skip { color: #95a5a6; }
.status-icon.taboo { color: #c0392b; }