:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --success: #10b981;
    --success-hover: #059669;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --easy: #34d399;
    --medium: #fbbf24;
    --hard: #f87171;
    --border-radius: 16px;
    --font-main: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

#app {
    width: 100%;
    max-width: 500px;
    position: relative;
}

.view {
    display: none;
    flex-direction: column;
    padding: 24px;
    min-height: 100dvh;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: flex;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 32px;
    margin-top: 24px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.highlight {
    color: var(--primary);
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Cards & Inputs */
.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card h2 {
    font-size: 1.25rem;
    margin-bottom: 16px;
    color: var(--text-main);
}

.input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

input[type="text"], .select-input {
    flex: 1;
    background-color: var(--bg-color);
    border: 1px solid #334155;
    color: var(--text-main);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

input[type="text"]:focus, .select-input:focus {
    border-color: var(--primary);
}

.select-input {
    width: 100%;
    margin-bottom: 16px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}

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

/* Lists */
.players-list {
    list-style: none;
}

.players-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #334155;
}

.players-list li:last-child {
    border-bottom: none;
}

.player-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.remove-btn {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
}

/* Buttons */
.btn {
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
    text-align: center;
}

.btn:active {
    transform: scale(0.96);
}

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

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

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

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

.btn-mega {
    background-color: var(--primary);
    color: white;
    width: 100%;
    padding: 18px;
    font-size: 1.25rem;
    border-radius: 16px;
    margin-top: auto;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    padding: 8px;
}

/* Game View Specifics */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.turn-indicator {
    font-size: 1.1rem;
    background-color: var(--card-bg);
    padding: 8px 16px;
    border-radius: 20px;
}

.word-card-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 32px 0;
}

.word-card {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 2px solid var(--primary);
    border-radius: 24px;
    padding: 40px 24px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.3);
    position: relative;
    animation: zoomIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

#current-word {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 20px 0;
    line-height: 1.2;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

.category-badge, .difficulty-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-badge {
    background-color: rgba(255, 255, 255, 0.1);
}

.difficulty-badge.easy { color: var(--easy); }
.difficulty-badge.medium { color: var(--medium); }
.difficulty-badge.hard { color: var(--hard); }

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: auto;
}

.action-buttons-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 32px;
}

/* Timer */
.timer-container {
    margin-bottom: 24px;
}
.timer-bar {
    width: 100%;
    height: 12px;
    background-color: var(--card-bg);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}
.timer-fill {
    height: 100%;
    background-color: var(--primary);
    width: 100%;
    transition: width 1s linear, background-color 0.3s;
}
.timer-fill.warning {
    background-color: var(--danger);
}
.timer-text {
    text-align: center;
    font-weight: 800;
    font-size: 1.2rem;
    font-variant-numeric: tabular-nums;
}

/* Scoreboard */
.scoreboard-list {
    list-style: none;
}
.scoreboard-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #334155;
    font-size: 1.2rem;
}
.scoreboard-list li:last-child {
    border-bottom: none;
}
.score-value {
    font-weight: 800;
    color: var(--primary);
    font-size: 1.4rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 24px;
}
.modal-overlay.hidden {
    display: none;
}
.modal-content {
    background-color: var(--card-bg);
    border-radius: 24px;
    padding: 32px 24px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    animation: slideUp 0.3s ease;
}

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

.modal-content h2 {
    margin-bottom: 8px;
}
.modal-content p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.guesser-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mt-4 {
    margin-top: 16px;
    width: 100%;
}
.hidden {
    display: none !important;
}
