:root {
    /* FlipSide Theme (Dark Retro) */
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --card-bg: rgba(30, 30, 30, 0.6);
    --card-border: rgba(100, 200, 210, 0.15);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

    /* Accents */
    --accent-cyan: #64c8d2;
    --accent-blue: #4fc3f7;
    --accent-green: #00e676;
    --accent-red: #ff5252;
    --accent-purple: #b388ff;

    --font-main: 'Outfit', sans-serif;
    --font-retro: 'Press Start 2P', cursive;

    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

[data-theme="light"] {
    --bg-color: #f0f0f0;
    --text-color: #2d2d2d;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(0, 0, 0, 0.05);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    --accent-cyan: #00838f;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    background-image: radial-gradient(circle at 50% 50%, rgba(100, 200, 210, 0.05) 0%, transparent 70%);
}

/* CRT Scanline Effect Overlay */
body::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    z-index: 999;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

.app-container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-top: 20px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.app-logo {
    height: 50px;
    width: auto;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 8px rgba(100, 200, 210, 0.3));
}

h1 {
    font-family: var(--font-retro);
    font-size: 1.2rem;
    letter-spacing: -1px;
    color: var(--accent-cyan);
    text-transform: uppercase;
    line-height: 1.4;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
}

h2 {
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--accent-cyan);
    font-size: 1.8rem;
}

p {
    opacity: 0.8;
    margin-bottom: 25px;
    line-height: 1.6;
    font-size: 1.05rem;
}

/* Buttons */
button {
    font-family: var(--font-main);
    border: none;
    cursor: pointer;
    outline: none;
    position: relative;
    overflow: hidden;
}

button:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--accent-cyan);
    color: #000;
    padding: 18px 36px;
    border-radius: var(--radius-md);
    font-weight: 800;
    font-size: 1.1rem;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(100, 200, 210, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(100, 200, 210, 0.5);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--accent-cyan);
    color: var(--accent-cyan);
    padding: 16px 32px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1rem;
    width: 100%;
}

.btn-secondary:hover {
    background: rgba(100, 200, 210, 0.1);
}

.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    padding: 10px;
    border-radius: 50%;
    border: 1px solid var(--card-border);
}

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

/* Theme Toggle Icons */
.sun-icon {
    display: block;
}

[data-theme="light"] .sun-icon {
    display: none;
}

[data-theme="light"] .moon-icon {
    display: block;
}

.moon-icon {
    display: none;
}

/* Stages */
.stage {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stage.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    padding: 40px 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    width: 100%;
    position: relative;
}

/* Circular Timer Button */
.timer-container {
    position: relative;
    width: 220px;
    height: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px 0;
}

.progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.1s linear;
    transform-origin: 50% 50%;
    stroke-dasharray: 565.48;
    /* 2 * PI * 90 */
    stroke-dashoffset: 565.48;
    stroke-linecap: round;
    filter: drop-shadow(0 0 4px currentColor);
}

.record-bubble {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), inset 0 2px 10px rgba(255, 255, 255, 0.2);
    z-index: 2;
    border: 4px solid rgba(255, 255, 255, 0.1);
}

.record-bubble .icon-mic {
    font-size: 2.5rem;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.record-bubble .label {
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.record-bubble.blue {
    background: linear-gradient(135deg, var(--accent-blue), #0288d1);
}

.record-bubble.red {
    background: linear-gradient(135deg, var(--accent-red), #d32f2f);
}

.record-bubble.recording {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 61, 0, 0.4);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 25px rgba(255, 61, 0, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 61, 0, 0);
    }
}

/* Controls Grid */
.controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
    margin-bottom: 30px;
}

.btn-action {
    padding: 24px;
    border-radius: var(--radius-md);
    color: #000;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-action span:first-child {
    font-size: 1.5rem;
}

.btn-action.green {
    background: linear-gradient(135deg, var(--accent-green), #00c853);
}

.btn-action.purple {
    background: linear-gradient(135deg, var(--accent-purple), #651fff);
    color: white;
}

.btn-action.big {
    width: 100%;
    padding: 30px;
    font-size: 1.2rem;
    flex-direction: row;
}

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--card-border), transparent);
    width: 100%;
    margin: 30px 0;
}

.results-grid {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.result-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
}

.mini-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-small {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-color);
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.btn-small:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-cyan);
}

[data-theme="light"] .btn-small {
    background: rgba(0, 0, 0, 0.05);
}