/* ===== Phase 10 Companion – Design System ===== */

/* --- CSS Custom Properties --- */
:root {
    /* Colors */
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(30, 30, 50, 0.7);
    --bg-card-hover: rgba(40, 40, 65, 0.8);
    --bg-input: rgba(20, 20, 40, 0.8);

    --primary: #7c3aed;
    --primary-light: #a78bfa;
    --primary-dark: #5b21b6;
    --accent: #3b82f6;
    --accent-light: #60a5fa;

    --success: #10b981;
    --success-light: #34d399;
    --danger: #ef4444;
    --danger-light: #f87171;
    --warning: #f59e0b;
    --warning-light: #fbbf24;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border: rgba(148, 163, 184, 0.12);
    --border-focus: rgba(124, 58, 237, 0.5);

    /* Glassmorphism */
    --glass-bg: rgba(30, 30, 55, 0.65);
    --glass-border: rgba(148, 163, 184, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --glass-blur: blur(20px);

    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;

    /* Z-Index */
    --z-dropdown: 50;
    --z-overlay: 100;
    --z-fab: 60;
    --z-toast: 200;

    /* Safe area */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

#app {
    position: relative;
    z-index: 1;
    min-height: 100dvh;
}

/* --- Views --- */
.view {
    display: none;
    min-height: 100dvh;
    padding-bottom: calc(100px + var(--safe-bottom));
}

.view.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

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

/* --- App Header --- */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(var(--space-md) + var(--safe-top)) var(--space-lg) var(--space-md);
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(to bottom, var(--bg-primary) 60%, transparent);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-icon {
    font-size: var(--font-size-3xl);
    filter: drop-shadow(0 0 8px rgba(124, 58, 237, 0.4));
}

.logo h1 {
    font-size: var(--font-size-xl);
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-sub {
    display: block;
    font-size: var(--font-size-xs);
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.7;
}

.header-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.spacer {
    width: 40px;
}

/* --- Round Info --- */
.round-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.round-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

.round-number {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: var(--primary-light);
    line-height: 1;
}

/* --- Buttons --- */
.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-icon:active {
    transform: scale(0.92);
}

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-md) var(--space-xl);
    border: none;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    font-family: var(--font);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

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

.btn-glow {
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.btn-glow::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translate(-30%, -30%); }
    50% { transform: translate(30%, 30%); }
}

.btn-emoji {
    font-size: var(--font-size-xl);
}

/* --- Glass Card --- */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--glass-shadow);
    transition: all var(--transition-base);
}

.glass-card:hover {
    border-color: rgba(148, 163, 184, 0.18);
}

/* --- SETUP VIEW --- */
.setup-content {
    padding: var(--space-md) var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.setup-card h2 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.subtitle {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-lg);
}

.player-input-row {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    max-width: 100%;
    overflow: hidden;
}

.player-input-row input {
    flex: 1;
    min-width: 0;
    padding: var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: var(--font-size-base);
    transition: border-color var(--transition-fast);
    outline: none;
}

.player-input-row input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.player-input-row input::placeholder {
    color: var(--text-muted);
}

.player-input-row .btn-icon {
    background: var(--primary);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.player-input-row .btn-icon:hover {
    background: var(--primary-light);
}

/* Player Chips */
.player-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    min-height: 40px;
    margin-bottom: var(--space-lg);
}

.player-chip {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 500;
    animation: chipIn 0.3s ease;
    border: none;
    cursor: default;
}

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

.player-chip .chip-remove {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.6;
    font-size: var(--font-size-lg);
    line-height: 1;
    padding: 0;
    display: flex;
    transition: opacity var(--transition-fast);
}

.player-chip .chip-remove:hover {
    opacity: 1;
}

/* Chip Farben */
.chip-color-0 { background: rgba(124, 58, 237, 0.3); color: #c4b5fd; }
.chip-color-1 { background: rgba(59, 130, 246, 0.3); color: #93c5fd; }
.chip-color-2 { background: rgba(16, 185, 129, 0.3); color: #6ee7b7; }
.chip-color-3 { background: rgba(245, 158, 11, 0.3); color: #fcd34d; }
.chip-color-4 { background: rgba(239, 68, 68, 0.3); color: #fca5a5; }
.chip-color-5 { background: rgba(236, 72, 153, 0.3); color: #f9a8d4; }

/* Info Card */
.info-card {
    background: rgba(124, 58, 237, 0.08);
    border-color: rgba(124, 58, 237, 0.2);
}

.info-card h3 {
    font-size: var(--font-size-base);
    margin-bottom: var(--space-sm);
}

.info-card p {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

.info-card em {
    color: var(--primary-light);
    font-style: normal;
    font-weight: 500;
}

/* --- GAME VIEW (Scoreboard) --- */
.game-header {
    padding-left: var(--space-md);
    padding-right: var(--space-sm);
}

/* Motivation Banner */
.motivation-banner {
    margin: 0 var(--space-lg) var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(59, 130, 246, 0.1));
    border: 1px solid rgba(124, 58, 237, 0.2);
    animation: bannerIn 0.5s ease;
}

.motivation-banner p {
    font-size: var(--font-size-sm);
    line-height: 1.5;
    color: var(--text-primary);
}

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

/* Player Cards */
.player-cards-container {
    padding: 0 var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    flex: 1;
    max-width: 100%;
    overflow: hidden;
}

.player-game-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: var(--space-xs) var(--space-md);
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    position: relative;
    overflow: hidden;
}

.player-game-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 0 4px 4px 0;
}

.player-rank-1::before { background: linear-gradient(to bottom, #fbbf24, #f59e0b); }
.player-rank-2::before { background: linear-gradient(to bottom, #94a3b8, #64748b); }
.player-rank-3::before { background: linear-gradient(to bottom, #d97706, #92400e); }
.player-rank-default::before { background: var(--primary); opacity: 0.5; }

.player-avatar {
    grid-row: span 2;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-lg);
    text-transform: uppercase;
}

.avatar-color-0 { background: rgba(124, 58, 237, 0.3); color: #c4b5fd; }
.avatar-color-1 { background: rgba(59, 130, 246, 0.3); color: #93c5fd; }
.avatar-color-2 { background: rgba(16, 185, 129, 0.3); color: #6ee7b7; }
.avatar-color-3 { background: rgba(245, 158, 11, 0.3); color: #fcd34d; }
.avatar-color-4 { background: rgba(239, 68, 68, 0.3); color: #fca5a5; }
.avatar-color-5 { background: rgba(236, 72, 153, 0.3); color: #f9a8d4; }

.player-name {
    font-weight: 600;
    font-size: var(--font-size-base);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-phase-badge {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    justify-self: end;
}

.phase-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    font-weight: 800;
    font-size: var(--font-size-base);
    color: white;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.player-details {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 0;
    overflow: hidden;
}

.player-score {
    font-weight: 600;
    color: var(--text-primary);
}

.player-phase-desc {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.phase-status {
    justify-self: end;
    font-size: var(--font-size-lg);
}

/* Bottom Action */
.bottom-action {
    padding: var(--space-md) var(--space-lg);
    position: sticky;
    bottom: calc(80px + var(--safe-bottom));
}

/* Dropdown Menu */
.dropdown-menu {
    position: fixed;
    top: calc(60px + var(--safe-top));
    right: var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    z-index: var(--z-dropdown);
    overflow: hidden;
    animation: dropIn 0.2s ease;
}

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.menu-item {
    display: block;
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    border: none;
    background: none;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: var(--font-size-sm);
    text-align: left;
    cursor: pointer;
    transition: background var(--transition-fast);
    white-space: nowrap;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.menu-item + .menu-item {
    border-top: 1px solid var(--border);
}

/* --- ROUND INPUT VIEW --- */
.round-content {
    padding: var(--space-md) var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.round-player-card {
    text-align: center;
    padding: var(--space-xl);
}

.round-player-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: var(--font-size-2xl);
    text-transform: uppercase;
    margin: 0 auto var(--space-md);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
}

.round-player-card h2 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.round-player-phase {
    color: var(--primary-light);
    font-weight: 600;
    font-size: var(--font-size-lg);
}

.round-phase-desc {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin-top: var(--space-xs);
}

.input-card label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
}

.input-card input[type="number"] {
    width: 100%;
    padding: var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: var(--font-size-2xl);
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: all var(--transition-fast);
    -moz-appearance: textfield;
    appearance: textfield;
}

.input-card input[type="number"]::-webkit-inner-spin-button,
.input-card input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.input-card input[type="number"]:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

/* Phase Toggle */
.phase-toggle-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.phase-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-lg);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.phase-toggle:hover {
    border-color: var(--text-muted);
}

.phase-toggle.selected[data-value="yes"] {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.12);
    color: var(--success-light);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}

.phase-toggle.selected[data-value="no"] {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger-light);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
}

/* --- RESULTS VIEW --- */
.results-content {
    padding: var(--space-md) var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    position: relative;
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    position: relative;
    z-index: 1;
}

.result-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    animation: resultIn 0.5s ease backwards;
}

.result-card:nth-child(1) { animation-delay: 0.1s; }
.result-card:nth-child(2) { animation-delay: 0.3s; }
.result-card:nth-child(3) { animation-delay: 0.5s; }
.result-card:nth-child(4) { animation-delay: 0.7s; }
.result-card:nth-child(5) { animation-delay: 0.9s; }
.result-card:nth-child(6) { animation-delay: 1.1s; }

@keyframes resultIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.result-rank {
    font-size: var(--font-size-3xl);
    font-weight: 900;
    min-width: 48px;
    text-align: center;
}

.rank-1 { color: #fbbf24; text-shadow: 0 0 20px rgba(251, 191, 36, 0.4); }
.rank-2 { color: #94a3b8; text-shadow: 0 0 20px rgba(148, 163, 184, 0.3); }
.rank-3 { color: #d97706; text-shadow: 0 0 20px rgba(217, 119, 6, 0.3); }
.rank-default { color: var(--text-muted); }

.result-card.winner {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.05));
    border-color: rgba(251, 191, 36, 0.3);
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.1);
}

.result-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.result-name {
    font-size: var(--font-size-lg);
    font-weight: 700;
}

.result-phase {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.result-score {
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--text-primary);
    text-align: right;
}

.result-score-label {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    font-weight: 400;
}

.winner-badge {
    font-size: var(--font-size-2xl);
    margin-left: var(--space-sm);
}

/* --- VOICE OVERLAY --- */
.voice-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 26, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.voice-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xl);
    padding: var(--space-xl);
    text-align: center;
    width: 100%;
    max-width: 400px;
}

.voice-context {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    font-weight: 500;
}

.voice-mic-area {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-mic-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 2;
    position: relative;
    box-shadow: 0 4px 30px rgba(124, 58, 237, 0.5);
}

.voice-rings {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-ring {
    position: absolute;
    border-radius: var(--radius-full);
    border: 2px solid var(--primary);
    opacity: 0;
}

.voice-overlay:not(.hidden) .voice-ring {
    animation: voicePulse 2s ease-out infinite;
}

.ring-1 {
    width: 100px;
    height: 100px;
    animation-delay: 0s !important;
}

.ring-2 {
    width: 120px;
    height: 120px;
    animation-delay: 0.5s !important;
}

.ring-3 {
    width: 140px;
    height: 140px;
    animation-delay: 1s !important;
}

@keyframes voicePulse {
    0% { opacity: 0.6; transform: scale(0.8); }
    100% { opacity: 0; transform: scale(1.3); }
}

.voice-status {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-primary);
}

.voice-transcript {
    font-size: var(--font-size-base);
    color: var(--primary-light);
    min-height: 1.5em;
    font-style: italic;
}

.btn-stop {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    border: none;
    border-radius: var(--radius-full);
    background: var(--danger);
    color: white;
    font-family: var(--font);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-stop:hover {
    background: var(--danger-light);
    transform: scale(1.05);
}

.btn-stop:active {
    transform: scale(0.95);
}

/* --- FLOATING MIC BUTTON --- */
.mic-fab {
    position: fixed;
    bottom: calc(24px + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-fab);
    width: 64px;
    height: 64px;
    border: none;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
}

.mic-fab:hover {
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 6px 30px rgba(124, 58, 237, 0.5);
}

.mic-fab:active {
    transform: translateX(-50%) scale(0.95);
}

.mic-fab-glow {
    position: absolute;
    inset: -4px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    opacity: 0.3;
    filter: blur(12px);
    animation: fabPulse 2s ease-in-out infinite;
}

@keyframes fabPulse {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.15); }
}

.mic-fab.recording {
    background: var(--danger);
    animation: micRecording 1s ease-in-out infinite;
}

.mic-fab.recording .mic-fab-glow {
    background: var(--danger);
}

@keyframes micRecording {
    0%, 100% { box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(239, 68, 68, 0.6); }
}

/* --- TOAST --- */
.toast-container {
    position: fixed;
    top: calc(var(--space-lg) + var(--safe-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
    width: calc(100% - var(--space-xl) * 2);
    max-width: 400px;
}

.toast {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    pointer-events: auto;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 3.7s forwards;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-align: center;
}

.toast-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success-light);
}

.toast-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger-light);
}

.toast-info {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--accent-light);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* --- HIDDEN UTILITY --- */
.hidden {
    display: none !important;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.2);
    border-radius: 2px;
}

/* --- Selection --- */
::selection {
    background: rgba(124, 58, 237, 0.4);
    color: white;
}

/* --- Focus visible --- */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* --- Responsive --- */
@media (min-width: 480px) {
    .setup-content,
    .round-content,
    .results-content,
    .player-cards-container {
        max-width: 440px;
        margin-left: auto;
        margin-right: auto;
        width: 100%;
    }

    .motivation-banner {
        max-width: 440px;
        margin-left: auto;
        margin-right: auto;
    }

    .bottom-action {
        max-width: 440px;
        margin-left: auto;
        margin-right: auto;
        width: 100%;
    }
}

/* --- BUILD FOOTER --- */
.build-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 2px var(--space-sm);
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.4;
    pointer-events: none;
    z-index: 1;
    font-family: var(--font);
    letter-spacing: 0.02em;
}
