:root {
    --bg: #020617;
    /* slate-950 */
    --panel: #0f172a;
    /* slate-900 */
    --panel2: #111827;
    /* slate-800-ish */
    --text: #e5e7eb;
    /* gray-200 */
    --muted: #94a3b8;
    /* slate-400 */
    --muted2: #64748b;
    /* slate-500 */
    --border: rgba(255, 255, 255, .10);
    --border2: rgba(255, 255, 255, .05);
    --blue: #2563eb;
    /* blue-600 */
    --blue2: #3b82f6;
    /* blue-500 */
    --cyan: #0e7490;
    --rose: #e11d48;
    --emerald: #10b981;
    --orange: #f97316;
    --shadow: 0 0 50px rgba(0, 0, 0, .5);
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
}

.select-none {
    user-select: none;
    -webkit-user-select: none;
}

.cookie-text {
    color: #444444;
}

.app {
    overflow: hidden;
}

.tint {
    position: absolute;
    inset: 0;
    opacity: .10;
    transition: background-color 1000ms;
}

.blob {
    position: absolute;
    width: 60%;
    height: 60%;
    border-radius: 999px;
    filter: blur(160px);
    opacity: .20;
}

.blob.top {
    top: -20%;
    left: -10%;
    background: #2563eb;
}

.blob.bot {
    bottom: -20%;
    right: -10%;
    background: #7c3aed;
}

/* purple */
/*.game-surface{*/
/*  position:absolute; inset:0;*/
/*  display:flex; align-items:center; justify-content:center;*/
/*  transition: background-color 150ms, transform 150ms;*/
/*}*/

.game-surface {
    width: 100%;
}

.surface-inner {
    width: 100%;
}

.btn-surface {
    width: 100%;
    height: var(--vh);
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    transition: .6s ease-in-out;
}

/* States (match Tailwind classes from the React app) */
.state-start,
.state-result {
    background: var(--blue);
}

.state-start:hover,
.state-result:hover {
    background: var(--blue2);
}

.state-waiting {
    background: var(--rose);
    cursor: progress;
}

.state-ready {
    background: var(--emerald);
}

.state-ready:active {
    transform: scale(.995);
    filter: brightness(1.03);
}

.state-early {
    background: #1f2937;
}

/* slate-800 */

/* Typography helpers */
.italic {
    font-style: italic;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.tight {
    letter-spacing: -.04em;
}

.track-widest {
    letter-spacing: .2em;
}

.track-wider {
    letter-spacing: .12em;
}

.uppercase {
    text-transform: uppercase;
}

.font-black {
    font-weight: 900;
}

.font-bold {
    font-weight: 700;
}

.font-light {
    font-weight: 300;
}

.muted {
    color: var(--muted);
}

.muted2 {
    color: var(--muted2);
}

/* Animations (approx tailwind animate-in set) */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .55;
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(24px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInBottom {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn .5s ease both;
}

.animate-zoom-in {
    animation: zoomIn .5s ease both;
}

.animate-slide-in-right {
    animation: slideInRight .5s ease both;
}

.animate-slide-in-bottom {
    animation: slideInBottom .3s ease both;
}

.animate-pulse {
    animation: pulse 1.3s ease-in-out infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

/* Bottom bar */
.bottom-bar {
    position: fixed;
    left: 50%;
    bottom: 48px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 8px;
    background: rgba(0, 0, 0, .40);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 32px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
    z-index: 40;
}

.bar-btn {
    border: 0;
    background: transparent;
    color: white;
    padding: 16px;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 120ms, background-color 120ms, opacity 120ms;
}

.bar-btn:hover {
    background: rgba(255, 255, 255, .10);
}

.bar-btn:active {
    transform: scale(.90);
}

.bar-sep {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, .10);
}

/* Panel (Biometrics) */
.panel {
    position: fixed;
    top: 110px;
    right: 24px;
    bottom: 24px;
    width: min(420px, calc(100vw - 48px));
    background: rgba(15, 23, 42, .95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 40px;
    padding: 32px;
    z-index: 50;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: auto;
    animation: slideInRight .5s ease both;
}

.panel {
    -ms-overflow-style: none;
    /* IE + old Edge */
    scrollbar-width: none;
    /* Firefox */
}

.panel::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.icon-btn {
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 8px;
    border-radius: 999px;
    cursor: pointer;
    transition: color 120ms, background-color 120ms, transform 200ms;
}

.icon-btn:hover {
    color: white;
    background: rgba(255, 255, 255, .10);
}

.icon-btn:hover svg {
    transform: rotate(90deg);
}

.icon-btn svg {
    width: 24px;
    height: 24px;
    transition: transform 200ms;
}

.label {
    font-size: 10px;
    color: var(--muted2);
    font-weight: 900;
    letter-spacing: .2em;
    text-transform: uppercase;
}

.segmented {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 4px;
    background: rgba(0, 0, 0, .40);
    border: 1px solid var(--border2);
    border-radius: 14px;
}

.seg-btn {
    border: 0;
    background: transparent;
    color: var(--muted2);
    font-weight: 900;
    font-size: 10px;
    padding: 8px 0;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 120ms, color 120ms, transform 120ms;
}

.seg-btn:hover {
    color: white;
    background: rgba(255, 255, 255, .05);
}

.seg-btn.active {
    background: var(--blue);
    color: white;
    box-shadow: 0 12px 20px rgba(30, 58, 138, .35);
}

.stats {
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 24px 0;
}

.stats:before {
    background: none;
}

.stat {
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--border2);
    border-radius: 28px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.stat .value {
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
}

.stat .ms {
    font-size: 12px;
    color: var(--muted2);
    font-style: italic;
    margin-left: 6px;
    font-weight: 500;
}

.stat svg {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    opacity: .10;
    transition: transform 200ms;
}

.stat:hover svg {
    transform: scale(1.25);
}

.chart-wrap {
    flex: 0 0 160px;
    min-height: 160px;
    margin-bottom: 24px;
    position: relative;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.chart-tooltip {
    position: absolute;
    pointer-events: none;
    background: #0f172a;
    border: 0;
    border-radius: 16px;
    padding: 8px 12px;
    color: #60a5fa;
    font-weight: 800;
    font-size: 12px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
    transform: translate(-50%, -120%);
    opacity: 0;
    transition: opacity 80ms;
    white-space: nowrap;
}

.chart-tooltip.show {
    opacity: 1;
}

.attempts {
    flex: 1 1 auto;
    overflow: auto;
    padding-right: 6px;
    margin-bottom: 18px;
    min-height: 100px;
}

.attempt {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--border2);
    border-radius: 18px;
    margin-bottom: 8px;
}

.attempt .time {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: -.02em;
    text-transform: uppercase;
    color: var(--muted2);
}

.attempt .msval {
    font-weight: 900;
    font-size: 18px;
    color: white;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.empty {
    padding: 26px;
    text-align: center;
    background: rgba(255, 255, 255, .05);
    border-radius: 28px;
    border: 1px dashed rgba(255, 255, 255, .10);
}

.wipe-btn {
    width: 100%;
    border: 1px solid var(--border2);
    background: rgba(255, 255, 255, .05);
    color: var(--muted2);
    padding: 16px;
    border-radius: 18px;
    cursor: pointer;
    font-weight: 900;
    letter-spacing: .3em;
    text-transform: uppercase;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background-color 120ms, color 120ms, transform 120ms, border-color 120ms;
}

.wipe-btn:hover {
    background: rgba(225, 29, 72, .10);
    color: #fb7185;
    border-color: rgba(225, 29, 72, .25);
}

.wipe-btn:active {
    transform: scale(.98);
}


/* Scrollbar */
.attempts::-webkit-scrollbar {
    width: 10px;
}

.attempts::-webkit-scrollbar-track {
    background: transparent;
}

.attempts::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .08);
    border-radius: 999px;
    border: 2px solid rgba(0, 0, 0, 0);
    background-clip: padding-box;
}

#surfaceButton {
    cursor: pointer;
}



/* Responsive tweaks */
@media (max-width: 640px) {
    .bottom-bar {
        bottom: 22px;
        gap: 14px;
    }

    .coach-btn {
        padding: 12px 22px;
    }

    .panel {
        padding: 24px;
        border-radius: 30px;
        right: 14px;
        bottom: 14px;
        width: calc(100vw - 28px);
    }
}