/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0d0d1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #252542;
    --bg-card-hover: #2d2d4a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;
    --accent-purple: #a855f7;
    --accent-pink: #ec4899;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;
    --accent-red: #ef4444;
    --gradient-primary: linear-gradient(135deg, #a855f7, #ec4899);
    --gradient-button: linear-gradient(90deg, #ec4899, #8b5cf6, #06b6d4);
    --border-color: #3d3d5c;
    --border-glow: rgba(168, 85, 247, 0.5);
    --shadow-glow: 0 0 20px rgba(168, 85, 247, 0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    height: 100%;
    position: relative;
    background: var(--bg-primary);
    overflow: hidden;
}

/* ===== Screen Management ===== */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* ===== Header ===== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
}

.header-spacer {
    width: 40px;
}

.btn-back {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-back:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-purple);
}

.btn-icon-only {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-text {
    background: none;
    border: none;
    color: var(--accent-orange);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

/* ===== Content Area ===== */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 100px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(168, 85, 247, 0.4);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-purple);
}

.btn-gradient {
    background: var(--gradient-button);
    background-size: 200% 100%;
    color: white;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.btn-large {
    width: 100%;
    padding: 18px 32px;
    font-size: 18px;
}

.bottom-action {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    padding: 20px;
    background: linear-gradient(to top, var(--bg-primary), transparent);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== Reveal Actions ===== */
.reveal-actions {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    padding: 20px;
    background: linear-gradient(to top, var(--bg-primary), transparent);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.reveal-actions .btn {
    width: 100%;
}

.action-hint {
    color: var(--accent-orange);
    font-size: 14px;
    margin: 0;
    transition: opacity 0.3s ease;
}

/* ===== Start Screen ===== */
.start-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 20px;
    text-align: center;
}

.logo-container {
    margin-bottom: 60px;
}

.logo-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.logo-title {
    font-size: 42px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.logo-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

.start-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 300px;
}

/* ===== How To Play ===== */
.howto-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.howto-step {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.howto-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.howto-text h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.howto-text p {
    font-size: 14px;
    color: var(--text-secondary);
}

.pro-tip {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(251, 191, 36, 0.1));
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    margin-top: 16px;
}

.pro-tip-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.pro-tip h4 {
    color: var(--accent-orange);
    margin-bottom: 8px;
}

.pro-tip p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===== How To Tips Button ===== */
.howto-tips-btn {
    margin-top: 20px;
    font-size: 16px;
    padding: 16px 24px;
}

/* ===== Counter Cards ===== */
.counter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.counter-card {
    background: var(--bg-card);
    border: 2px solid var(--accent-purple);
    border-radius: var(--radius-xl);
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.counter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.counter-card.imposter {
    border-color: var(--accent-pink);
}

.counter-icon {
    font-size: 32px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.counter-icon svg {
    stroke: var(--accent-purple);
}

.imposter .counter-icon svg {
    stroke: var(--accent-pink);
}

.question-mark {
    position: absolute;
    right: -5px;
    top: -5px;
    background: var(--accent-cyan);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.counter-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.counter-value {
    font-size: 48px;
    font-weight: 700;
    display: block;
    margin-bottom: 12px;
}

.counter-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.counter-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.counter-btn:hover {
    border-color: var(--accent-purple);
    background: var(--bg-card-hover);
}

.counter-btn.red {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.counter-btn.green {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--accent-green);
    color: var(--accent-green);
}

/* ===== Menu Buttons ===== */
.menu-button {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 24px;
}

.menu-button:hover {
    border-color: var(--accent-purple);
    background: var(--bg-card-hover);
}

.menu-button-icon {
    color: var(--accent-purple);
    font-size: 20px;
}

.menu-arrow {
    margin-left: auto;
    color: var(--accent-orange);
}

/* ===== Sections ===== */
.section {
    margin-bottom: 24px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.section-icon {
    font-size: 20px;
}

/* ===== Mode Cards ===== */
.mode-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.mode-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-card:hover {
    border-color: var(--accent-purple);
}

.mode-card.active {
    border-color: var(--accent-pink);
    background: rgba(236, 72, 153, 0.1);
}

.mode-icon {
    font-size: 36px;
    font-weight: 700;
    color: var(--accent-pink);
    display: block;
    margin-bottom: 8px;
}

.mode-card h3 {
    font-size: 14px;
    margin-bottom: 6px;
}

.mode-card p {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ===== Categories ===== */
.categories-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.categories-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.categories-count {
    color: var(--text-muted);
    font-size: 14px;
}

.categories-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-tag {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.category-tag.active {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: white;
}

/* ===== Toggle Switch ===== */
.settings-toggles {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-icon {
    font-size: 20px;
}

.toggle {
    position: relative;
    width: 52px;
    height: 28px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-card);
    border-radius: 28px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 2px;
    bottom: 2px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle input:checked+.toggle-slider {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
}

.toggle input:checked+.toggle-slider::before {
    transform: translateX(24px);
    background: white;
}

.timer-select {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
}

/* ===== Players List ===== */
.player-count-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.player-count-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.player-count-value {
    font-size: 32px;
    font-weight: 700;
    flex: 1;
}

.player-count-controls {
    display: flex;
    gap: 8px;
}

.players-section-title {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.player-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
}

.player-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    position: relative;
}

.player-avatar .edit-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: var(--accent-pink);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.player-info {
    flex: 1;
}

.player-number {
    font-size: 12px;
    color: var(--text-muted);
}

.player-name {
    font-size: 16px;
    font-weight: 600;
}

.player-name-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    outline: none;
}

.player-delete {
    background: none;
    border: none;
    color: var(--accent-red);
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.player-delete:hover {
    opacity: 1;
}

.add-player-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px;
    background: transparent;
    border: 2px dashed var(--accent-green);
    border-radius: var(--radius-lg);
    color: var(--accent-green);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-player-btn:hover {
    background: rgba(16, 185, 129, 0.1);
}

.add-icon {
    width: 32px;
    height: 32px;
    background: rgba(16, 185, 129, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* ===== Reveal Screen ===== */
.reveal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 40px;
}

.reveal-subtitle {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.reveal-category {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
}

.reveal-card-container {
    perspective: 1000px;
    width: 280px;
    height: 180px;
    margin-bottom: 20px;
}

.reveal-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    cursor: pointer;
}

.reveal-card.revealed {
    transform: rotateY(180deg);
}

.reveal-card-front,
.reveal-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.reveal-card-front {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
}

.tap-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.reveal-card-back {
    background: linear-gradient(135deg, #1e3a5f, #0f2744);
    border: 3px solid var(--accent-cyan);
    transform: rotateY(180deg);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.3);
}

.reveal-card-back.imposter {
    background: linear-gradient(135deg, #3d1515, #1a0808);
    border-color: var(--accent-red);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.4);
}

.word-display {
    font-size: 32px;
    font-weight: 800;
    color: var(--accent-cyan);
}

.word-display.imposter {
    color: var(--accent-red);
}

.category-hint {
    color: var(--accent-cyan);
    font-size: 14px;
    margin-top: 12px;
}

.reveal-actions {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    padding: 20px;
    display: flex;
    gap: 12px;
    background: linear-gradient(to top, var(--bg-primary), transparent);
}

.reveal-actions .btn {
    flex: 1;
}

/* ===== Game Screen ===== */
.game-content {
    text-align: center;
}

.timer-display {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 12px 24px;
    margin-bottom: 24px;
}

.timer-display.hidden {
    display: none;
}

.timer-icon {
    font-size: 24px;
}

.timer-value {
    font-size: 28px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.game-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 24px;
}

.game-info-card h2 {
    font-size: 20px;
    margin-bottom: 12px;
}

.game-info-card p {
    color: var(--text-secondary);
    font-size: 14px;
}

.player-order h3 {
    font-size: 16px;
    margin-bottom: 16px;
    text-align: left;
}

.turn-order-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.turn-player {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}

.turn-number {
    width: 28px;
    height: 28px;
    background: var(--accent-purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.game-actions {
    margin-top: 32px;
}

/* ===== Vote Screen ===== */
.vote-instruction {
    text-align: center;
    margin-bottom: 24px;
}

.vote-instruction h2 {
    font-size: 20px;
    margin-bottom: 8px;
}

.vote-instruction p {
    color: var(--text-secondary);
}

.vote-players {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vote-player {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vote-player:hover {
    border-color: var(--accent-purple);
}

.vote-player.selected {
    border-color: var(--accent-red);
    background: rgba(239, 68, 68, 0.1);
}

.vote-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.vote-name {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
}

.vote-check {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.vote-player.selected .vote-check {
    background: var(--accent-red);
    border-color: var(--accent-red);
}

/* ===== Results Screen ===== */
.results-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding-top: 40px;
}

.results-reveal {
    background: var(--bg-card);
    border: 2px solid var(--accent-red);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 100%;
    max-width: 320px;
}

.results-reveal h2 {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.imposter-name {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent-red);
    margin-bottom: 8px;
}

.imposter-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.word-reveal {
    background: var(--bg-card);
    border: 2px solid var(--accent-cyan);
    border-radius: var(--radius-xl);
    padding: 24px;
    width: 100%;
    max-width: 320px;
}

.word-reveal h3 {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.word-reveal .word {
    font-size: 32px;
    font-weight: 800;
    color: var(--accent-cyan);
}

.results-actions {
    flex-direction: column;
}

/* ===== Avatar Colors ===== */
.avatar-1 {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.avatar-2 {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.avatar-3 {
    background: linear-gradient(135deg, #10b981, #047857);
}

.avatar-4 {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.avatar-5 {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

.avatar-6 {
    background: linear-gradient(135deg, #ec4899, #be185d);
}

.avatar-7 {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.avatar-8 {
    background: linear-gradient(135deg, #84cc16, #65a30d);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* ===== Animations ===== */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ===== Disabled Mode Card ===== */
.mode-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.mode-card.disabled .mode-icon {
    color: var(--text-muted);
}

/* ===== Player Cards Grid ===== */
.players-progress {
    margin-bottom: 16px;
}

.progress-text {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.progress-bar {
    height: 6px;
    background: var(--bg-card);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.reveal-instruction {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
}

.player-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.player-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.player-card:hover:not(.revealed) {
    border-color: var(--accent-purple);
    transform: translateY(-2px);
}

.player-card.revealed {
    border-color: var(--accent-green);
    background: rgba(16, 185, 129, 0.1);
    cursor: default;
}

.player-card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 12px;
}

.player-card.revealed .player-card-avatar {
    background: var(--accent-green) !important;
}

.player-card-name {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.player-card-status {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}

.player-card.revealed .player-card-status {
    color: var(--accent-green);
}

/* ===== Action Hint ===== */
.action-hint {
    text-align: center;
    color: var(--accent-orange);
    font-size: 14px;
    margin-top: 8px;
}

/* ===== Disabled Button ===== */
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-card);
    animation: none;
}

/* ===== Game Tips ===== */
.game-tips {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.tip-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
}

.tip-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.tip-item p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ===== Select All Button ===== */
.select-all-btn {
    background: var(--accent-purple);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.select-all-btn:hover {
    background: var(--accent-pink);
    transform: scale(1.05);
}

.categories-count {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 12px;
}

/* ===== Tips Button ===== */
.btn-tips {
    width: 100%;
    margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.2));
    border: 1px solid var(--accent-purple);
}

.btn-tips:hover {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(236, 72, 153, 0.3));
}

/* ===== Compact Button ===== */
.btn-compact {
    padding: 12px 24px;
    font-size: 16px;
}

/* ===== Game Actions Row ===== */
.game-actions-row {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

/* ===== Elapsed Timer ===== */
.elapsed-timer {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(52, 211, 153, 0.1));
    border-color: var(--accent-green);
}

.elapsed-timer .timer-value {
    color: var(--accent-green);
}

/* ===== Tips Modal ===== */
.tips-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tips-modal.active {
    opacity: 1;
}

.tips-modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    max-width: 420px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.tips-modal.active .tips-modal-content {
    transform: scale(1);
}

.tips-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
}

.tips-modal-header h2 {
    font-size: 18px;
}

.tips-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tips-close-btn:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
}

.tips-modal-body {
    padding: 20px;
}

.tips-section {
    margin-bottom: 24px;
}

.tips-section:last-child {
    margin-bottom: 0;
}

.tips-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--accent-cyan);
}

.tips-category {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 10px;
}

.tips-category h4 {
    font-size: 14px;
    color: var(--accent-purple);
    margin-bottom: 6px;
}

.tips-category p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.strategy-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 10px;
}

.strategy-item strong {
    display: block;
    color: var(--accent-orange);
    margin-bottom: 4px;
    font-size: 14px;
}

.strategy-item p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== Countdown Overlay ===== */
.countdown-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.countdown-content {
    text-align: center;
}

.countdown-number {
    font-size: 120px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 16px;
}

.countdown-content p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* ===== Pulse Animation for Countdown ===== */
.pulse-animation {
    animation: countdownPulse 1s ease;
}

@keyframes countdownPulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===== Player Card Animation ===== */
.player-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-card:active:not(.revealed) {
    transform: scale(0.95);
}

.player-card.revealed {
    animation: cardReveal 0.5s ease;
}

@keyframes cardReveal {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* ===== Screen Transitions ===== */
.screen {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reveal Card Animation Enhancement ===== */
.reveal-card {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-card.revealed {
    animation: cardFlip 0.6s ease;
}

@keyframes cardFlip {
    0% {
        transform: rotateY(0deg);
    }

    100% {
        transform: rotateY(180deg);
    }
}

/* ===== PWA Native App Styles ===== */

/* iOS Safe Area Support - applied in standalone mode */
@supports (padding: env(safe-area-inset-top)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* Prevent pull-to-refresh on mobile */
html {
    overscroll-behavior: none;
}

/* Prevent text selection for app-like feel */
.btn,
.counter-btn,
.player-card,
.mode-card,
.category-tag {
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Smooth touch scrolling */
.content {
    -webkit-overflow-scrolling: touch;
}

/* Standalone mode adjustments (iOS PWA) */
@media (display-mode: standalone) {

    /* Extra padding for notched devices */
    .header {
        padding-top: max(16px, env(safe-area-inset-top));
    }

    .bottom-action,
    .reveal-actions {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }

    /* Hide any browser-specific UI elements */
    .browser-only {
        display: none !important;
    }
}

/* iOS standalone fallback */
@media screen and (max-width: 768px) {
    @supports (-webkit-touch-callout: none) {

        /* iOS specific styles */
        .header {
            padding-top: max(16px, constant(safe-area-inset-top));
            padding-top: max(16px, env(safe-area-inset-top));
        }

        .bottom-action,
        .reveal-actions {
            padding-bottom: max(20px, constant(safe-area-inset-bottom));
            padding-bottom: max(20px, env(safe-area-inset-bottom));
        }
    }
}

/* Improve touch targets */
.btn,
button {
    min-height: 44px;
    touch-action: manipulation;
}

/* Prevent zoom on input focus (iOS) */
input,
select,
textarea {
    font-size: 16px;
}

/* Full height app container */
html,
body {
    height: 100%;
    height: -webkit-fill-available;
}

body {
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

#app {
    background: var(--bg-primary);
    min-height: 100%;
    min-height: -webkit-fill-available;
}