/**
 * Hydros OS - Music Player, Stopwatch & Arcade Game (Cyber Neon Snake)
 */

/* ========================================================
   MUSIC APP STYLING
   ======================================================== */
.music-scroll-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px 85px;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

.music-search-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px 12px;
    margin-bottom: 16px;
    gap: 10px;
    color: var(--text-sub);
}

.music-search-container input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 13px;
    width: 100%;
    outline: none;
}

.music-search-container input::placeholder {
    color: var(--text-sub);
}

.music-section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 14px 0 10px;
}

.music-section-header h3 {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.music-sub-header {
    font-size: 12px;
    color: var(--text-sub);
}

.music-shuffle-all-btn {
    background: rgba(250, 35, 59, 0.15);
    border: 1px solid rgba(250, 35, 59, 0.4);
    color: #ff5277;
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.music-featured-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 6px;
}

.music-featured-card {
    width: 100%;
    border-radius: 16px;
    padding: 12px;
    min-height: 112px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.music-featured-card:active {
    transform: scale(0.96);
}

.music-featured-card.feat-lofi {
    background: linear-gradient(135deg, #ff7e5f, #feb47b);
    color: #2b1704;
}

.music-featured-card.feat-synth {
    background: linear-gradient(135deg, #ec008c, #fc6767);
    color: #fff;
}

.music-featured-card.feat-edm {
    background: linear-gradient(135deg, #00c6ff, #0072ff);
    color: #fff;
}

.music-featured-card.feat-ambient {
    background: linear-gradient(135deg, #654ea3, #eaafc8);
    color: #fff;
}

.music-feat-badge {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    opacity: 0.85;
}

.music-feat-title {
    font-size: 14px;
    font-weight: 700;
    margin-top: 3px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-feat-artist {
    font-size: 11px;
    opacity: 0.85;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-feat-play-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    margin-left: auto;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.music-genre-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding-bottom: 6px;
}

.music-pill {
    padding: 6px 13px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.music-pill.active {
    background: #fa233b;
    color: #fff;
    border-color: #fa233b;
    box-shadow: 0 2px 10px rgba(250, 35, 59, 0.4);
}

.music-track-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.music-track-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.15s, transform 0.15s, border-color 0.15s;
}

.music-track-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.music-track-item:active {
    transform: scale(0.985);
}

.music-track-item.playing {
    background: rgba(250, 35, 59, 0.15);
    border-color: rgba(250, 35, 59, 0.4);
}

.music-art-thumb {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 17px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.music-track-info {
    flex: 1;
    min-width: 0;
}

.music-track-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-track-artist {
    font-size: 11px;
    color: var(--text-sub);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-track-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.music-track-genre-badge {
    font-size: 10px;
    padding: 3px 7px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-sub);
    font-weight: 500;
}

.music-track-duration {
    font-size: 12px;
    color: var(--text-sub);
}

.sound-bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
}

.sound-bar {
    width: 2.5px;
    background: #fa233b;
    border-radius: 2px;
    animation: soundBarBounce 0.7s infinite alternate ease-in-out;
}

.sound-bar:nth-child(1) {
    height: 35%;
    animation-delay: 0.1s;
}

.sound-bar:nth-child(2) {
    height: 95%;
    animation-delay: 0.3s;
}

.sound-bar:nth-child(3) {
    height: 60%;
    animation-delay: 0.2s;
}

@keyframes soundBarBounce {
    0% {
        height: 25%;
    }

    100% {
        height: 100%;
    }
}

/* Mini Player (Floating in Music App) */
.music-mini-player {
    position: absolute;
    bottom: 22px;
    left: 10px;
    right: 10px;
    height: 56px;
    border-radius: 15px;
    background: rgba(30, 30, 36, 0.94);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 10px;
    z-index: 50;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.music-mini-player:active {
    transform: scale(0.985);
}

.mini-player-art {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
    background: linear-gradient(135deg, #fa233b, #fb5c74);
    flex-shrink: 0;
    overflow: hidden;
}

.mini-player-info {
    flex: 1;
    min-width: 0;
}

.mini-player-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-player-artist {
    font-size: 11px;
    color: var(--text-sub);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-player-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mini-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
}

.mini-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mini-player-progress-bar {
    position: absolute;
    bottom: 0;
    left: 14px;
    right: 14px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.mini-player-progress-fill {
    height: 100%;
    width: 0%;
    background: #fa233b;
    transition: width 0.2s linear;
}

/* Full Screen Now Playing Sheet */
.music-full-player {
    position: absolute;
    inset: 0;
    z-index: 6100;
    background: #141418;
    background: radial-gradient(circle at 50% 25%, rgba(250, 35, 59, 0.22), transparent 70%), #141418;
    color: #fff;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s ease;
    will-change: transform;
    padding: calc(44px + env(safe-area-inset-top, 0px)) 24px calc(24px + env(safe-area-inset-bottom, 10px));
    overflow-y: auto;
}

.music-full-player.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.full-player-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.full-player-close-btn,
.full-player-fav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.full-player-close-btn:hover,
.full-player-fav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.full-player-fav-btn.active {
    color: #fa233b;
}

.full-player-subhead {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
}

.full-player-art-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0 24px;
    position: relative;
}

.full-player-art-card {
    width: 220px;
    height: 220px;
    border-radius: 24px;
    background: linear-gradient(135deg, #fa233b, #fb5c74);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
    position: relative;
    transition: transform 0.3s ease;
}

.full-player-art-card .vinyl-disc {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: repeating-radial-gradient(#151515, #151515 4px, #262626 5px, #151515 6px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    right: 0;
    top: 10px;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.4s, transform 0.4s;
}

.full-player-art-card.playing .vinyl-disc {
    opacity: 0.9;
    transform: translateX(38px);
    animation: vinylSpin 6s linear infinite;
}

@keyframes vinylSpin {
    100% {
        transform: translateX(38px) rotate(360deg);
    }
}

.full-player-art-center {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: #fff;
    background: inherit;
}

.full-player-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.full-player-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    line-height: 1.25;
}

.full-player-artist {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
}

.full-player-genre-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
}

.full-player-scrubber-box {
    margin-bottom: 18px;
}

.full-player-slider {
    width: 100%;
    -webkit-appearance: none;
    height: 4px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    cursor: pointer;
}

.full-player-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.full-player-times {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 6px;
}

.full-player-transport {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    margin-bottom: 18px;
}

.ctrl-btn-primary {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: #fff;
    color: #111;
    border: none;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
    transition: transform 0.15s, opacity 0.15s;
}

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

.ctrl-btn-step {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.15s;
}

.ctrl-btn-secondary {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.15s;
}

.ctrl-btn-secondary.active {
    color: #fa233b;
}

.full-player-visualizer-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.full-player-volume-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px;
}

.full-player-volume-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
}

.full-player-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

/* Lock Screen Music Card */
.lock-music-widget {
    width: 88%;
    max-width: 320px;
    margin-top: 10px;
    background: rgba(30, 30, 36, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    padding: 12px 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    color: #fff;
    pointer-events: auto;
}

.lock-music-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lock-music-art {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fa233b, #fb5c74);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
    overflow: hidden;
}

.lock-music-info {
    flex: 1;
    min-width: 0;
}

.lock-music-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lock-music-artist {
    font-size: 11px;
    color: var(--text-sub);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lock-music-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lock-ctrl-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.lock-ctrl-btn.play {
    background: #fff;
    color: #111;
    font-size: 12px;
}

.lock-music-progress-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.lock-music-progress-fill {
    height: 100%;
    width: 0%;
    background: #fa233b;
    border-radius: 2px;
}

/* ============================================================
   STOPWATCH APP STYLES
   ============================================================ */
#stopwatchApp {
    background: #000000;
    color: #ffffff;
    user-select: none;
    -webkit-user-select: none;
}

body.liquid-glass-mode #stopwatchApp {
    background: rgba(10, 10, 14, 0.88);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
}

.stopwatch-container {
    width: 100%;
    height: 100%;
    max-width: 440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    position: relative;
}

.stopwatch-nav {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 44px;
    flex-shrink: 0;
}

.stopwatch-nav h2 {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.stopwatch-sound-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.75);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.stopwatch-sound-btn.active {
    background: rgba(255, 159, 10, 0.2);
    border-color: rgba(255, 159, 10, 0.4);
    color: #ff9f0a;
}

.stopwatch-display-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 16px 8px;
    flex-shrink: 0;
}

.stopwatch-dial-wrapper {
    position: relative;
    width: clamp(210px, 32vh, 250px);
    height: clamp(210px, 32vh, 250px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stopwatch-dial-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.stopwatch-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 4;
}

.stopwatch-ticks {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 1.5;
    stroke-dasharray: 2 11.83;
}

.stopwatch-progress {
    fill: none;
    stroke: #ff9f0a;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 659.73;
    stroke-dashoffset: 659.73;
    transition: stroke-dashoffset 0.035s linear;
}

.stopwatch-needle {
    stroke: #ff9f0a;
    stroke-width: 2.5;
    stroke-linecap: round;
    transform-origin: 120px 120px;
    transform: rotate(0deg);
    filter: drop-shadow(0 0 4px rgba(255, 159, 10, 0.65));
}

.stopwatch-pivot {
    fill: #ff9f0a;
    stroke: #ffffff;
    stroke-width: 1.5;
}

.stopwatch-digits-container {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.stopwatch-main-time {
    font-size: clamp(34px, 5.2vh, 46px);
    font-weight: 200;
    letter-spacing: -0.5px;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.stopwatch-lap-time {
    font-size: clamp(13px, 2vh, 15px);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    font-variant-numeric: tabular-nums;
    margin-top: 5px;
    letter-spacing: 0.2px;
}

/* Dual iOS Circular Buttons */
.stopwatch-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px clamp(20px, 6vw, 36px) 14px;
    flex-shrink: 0;
}

.stopwatch-btn {
    width: clamp(66px, 10vh, 76px);
    height: clamp(66px, 10vh, 76px);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    transition: transform 0.12s ease, filter 0.12s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

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

.stopwatch-btn-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 500;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

/* Start Button (Green) */
.stopwatch-btn.start {
    background: rgba(52, 199, 89, 0.15);
}

.stopwatch-btn.start .stopwatch-btn-inner {
    background: rgba(52, 199, 89, 0.25);
    color: #34c759;
    border-color: rgba(52, 199, 89, 0.4);
}

/* Stop Button (Red) */
.stopwatch-btn.stop {
    background: rgba(255, 59, 48, 0.15);
}

.stopwatch-btn.stop .stopwatch-btn-inner {
    background: rgba(255, 59, 48, 0.25);
    color: #ff3b30;
    border-color: rgba(255, 59, 48, 0.4);
}

/* Secondary / Lap / Reset (Gray) */
.stopwatch-btn.secondary {
    background: rgba(142, 142, 147, 0.15);
}

.stopwatch-btn.secondary .stopwatch-btn-inner {
    background: rgba(142, 142, 147, 0.25);
    color: #ffffff;
    border-color: rgba(142, 142, 147, 0.35);
}

.stopwatch-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.stopwatch-dots-indicator {
    display: flex;
    gap: 6px;
}

.stopwatch-dots-indicator .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.stopwatch-dots-indicator .dot.active {
    background: #ffffff;
}

/* Laps Table */
.stopwatch-laps-wrapper {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0 16px 28px;
    margin-top: 2px;
}

.stopwatch-laps-header {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stopwatch-laps-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.stopwatch-lap-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-variant-numeric: tabular-nums;
    animation: fadeInLap 0.2s ease;
}

@keyframes fadeInLap {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

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

.stopwatch-lap-row.fastest {
    color: #34c759 !important;
}

.stopwatch-lap-row.fastest .stopwatch-lap-split,
.stopwatch-lap-row.fastest .stopwatch-lap-name {
    color: #34c759 !important;
    font-weight: 600;
}

.stopwatch-lap-row.slowest {
    color: #ff3b30 !important;
}

.stopwatch-lap-row.slowest .stopwatch-lap-split,
.stopwatch-lap-row.slowest .stopwatch-lap-name {
    color: #ff3b30 !important;
    font-weight: 600;
}

.stopwatch-lap-name {
    font-weight: 500;
    color: #ffffff;
    width: 70px;
}

.stopwatch-lap-split {
    color: #ffffff;
    font-weight: 500;
    text-align: center;
    flex: 1;
}

.stopwatch-lap-total {
    color: rgba(255, 255, 255, 0.55);
    font-weight: 400;
    width: 75px;
    text-align: right;
}

.stopwatch-laps-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.25);
    padding: 24px 12px;
    font-size: 13px;
}

/* ============================================================
   ARCADE GAME APP STYLES (Cyber Neon Snake)
   ============================================================ */
#gameApp {
    background: #060712;
    color: #ffffff;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.liquid-glass-mode #gameApp {
    background: rgba(8, 10, 20, 0.9);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
}

.arcade-container {
    width: 100%;
    height: 100%;
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    position: relative;
}

.arcade-container.giant-mode .arcade-controls-area {
    display: none !important;
}

.arcade-container.giant-mode .arcade-arena-wrapper {
    margin: 4px 6px 6px;
    border-radius: 22px;
}

.arcade-nav {
    height: 44px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.arcade-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.arcade-title-badge {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #7928ca, #ff0080);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 0, 128, 0.35);
}

.arcade-title-text {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #ffffff, #d8b4fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.arcade-nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.arcade-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.arcade-icon-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.arcade-icon-btn.active {
    color: #00f2fe;
    border-color: rgba(0, 242, 254, 0.4);
    background: rgba(0, 242, 254, 0.15);
}

/* Score Dashboard Bar */
.arcade-score-bar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 8px 14px 6px;
    flex-shrink: 0;
    gap: 8px;
}

.arcade-score-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 5px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.arcade-score-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

.arcade-score-val {
    font-size: clamp(16px, 2.5vh, 20px);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #4ade80;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
    line-height: 1.2;
}

.arcade-score-card.best .arcade-score-val {
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.arcade-score-card.speed .arcade-score-val {
    color: #f87171;
    text-shadow: 0 0 10px rgba(248, 113, 113, 0.5);
}

/* Arena Wrapper & Canvas (Lush Grass Garden) - Maximized Flexbox Layout */
.arcade-arena-wrapper {
    position: relative;
    margin: 4px 10px 4px;
    background: #4d7c2c;
    border-radius: 20px;
    border: 3px solid #36571e;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 20px rgba(54, 87, 30, 0.4);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    flex: 1;
    min-height: 0;
    width: calc(100% - 20px);
}

#snakeCanvas {
    display: block;
    border-radius: 15px;
}

/* Overlays (Start, Pause, Game Over) */
.arcade-overlay {
    position: absolute;
    inset: 0;
    background: rgba(14, 24, 10, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.arcade-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.arcade-overlay-badge {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 12px;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
}

.arcade-overlay h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #fff;
}

.arcade-overlay p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 16px;
    max-width: 220px;
    line-height: 1.4;
}

.arcade-primary-btn {
    background: linear-gradient(135deg, #22c55e, #15803d);
    color: #ffffff;
    border: none;
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.15s ease, filter 0.15s ease;
}

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

.arcade-secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 8px 18px;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.2s ease;
}

/* Virtual Controller (D-Pad) for Touch */
.arcade-controls-area {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2px 14px 6px;
    transition: all 0.25s ease;
}

.arcade-dpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 6px;
    width: clamp(116px, 15vh, 138px);
    height: clamp(116px, 15vh, 138px);
    margin: 0 auto;
}

.dpad-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(15px, 2.2vh, 19px);
    cursor: pointer;
    transition: transform 0.08s ease, background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.dpad-btn:active,
.dpad-btn.pressed {
    background: rgba(34, 197, 94, 0.25);
    border-color: #22c55e;
    color: #4ade80;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
    transform: scale(0.92);
}

.dpad-btn.up {
    grid-column: 2;
    grid-row: 1;
}

.dpad-btn.left {
    grid-column: 1;
    grid-row: 2;
}

.dpad-btn.center {
    grid-column: 2;
    grid-row: 2;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    cursor: default;
    pointer-events: none;
}

.dpad-btn.right {
    grid-column: 3;
    grid-row: 2;
}

.dpad-btn.down {
    grid-column: 2;
    grid-row: 3;
}

.arcade-desktop-tip {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
    margin-top: 4px;
}
