:root {
    --bg-color: #0f0f13;
    --card-bg: #1a1a24;
    --primary: #e94560;
    /* Reddish pink */
    --secondary: #533483;
    /* Deep purple */
    --accent: #0f3460;
    /* Dark blue */
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --border-color: #2a2a35;
    --success: #4caf50;
    --danger: #f44336;
    --font-family: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.app-container {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

header {
    text-align: center;
    margin-bottom: 10px;
    cursor: pointer;
    /* Hint for interaction */
    user-select: none;
}

header h1 {
    font-size: 2.5rem;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.card {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

h2,
h3 {
    margin-bottom: 16px;
    color: var(--text-main);
}

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.row {
    display: flex;
    gap: 10px;
}

input[type="text"] {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font-family);
    font-size: 1rem;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-family: var(--font-family);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn.primary {
    background-color: var(--primary);
    color: white;
}

.btn.primary:hover:not(:disabled) {
    background-color: #d63d56;
    transform: translateY(-1px);
}

.btn.secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.btn.secondary:hover:not(:disabled) {
    border-color: var(--text-main);
    color: var(--text-main);
}

.btn.accent {
    background-color: var(--secondary);
    color: white;
    width: 100%;
}

.btn.small {
    padding: 8px 16px;
    font-size: 0.85rem;
    align-items: center;
    margin-bottom: 16px;
}

.btn.full-width {
    width: 100%;
}

.mt-20 {
    margin-top: 20px;
}

.hidden {
    display: none;
}

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

.status-badge {
    background: rgba(233, 69, 96, 0.2);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.script-card {
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

#script-text {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 32px;
    flex-grow: 1;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--card-bg);
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.game-player-item {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Action Buttons in Script */
.action-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn.selected {
    background: var(--primary);
    border-color: var(--primary);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Timer */
.timer-box {
    background: rgba(0, 0, 0, 0.2);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
}

.timer-box.hidden {
    display: none;
}

.timer-display {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: monospace;
    margin-bottom: 12px;
    color: var(--primary);
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
}

/* Feedback Messages */
.feedback-msg {
    font-size: 1.2rem;
    font-weight: 600;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    margin-top: 20px;
}

.feedback-positive {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.feedback-negative {
    background: rgba(244, 67, 54, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
}

/* Reveal Card */
.center-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 400px;
}

.reveal-card {
    width: 100%;
    max-width: 300px;
    height: 200px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin: 20px 0;
    transition: all 0.3s;
}

.reveal-card:hover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

.reveal-front,
.reveal-back {
    padding: 20px;
}

.reveal-back.hidden {
    display: none;
}

.reveal-front p {
    font-size: 1.2rem;
    color: var(--text-muted);
}

#revealed-role {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.role-desc {
    font-size: 0.9rem;
    color: var(--text-main);
}

/* Mod Panel List */
.mod-player-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mod-role-select {
    background: var(--bg-color);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 6px;
    border-radius: 4px;
}
