/**
 * Stepp Fitness Tetris - Dark Industrial Gym Arcade Style
 */

:root {
    --bg-dark: #0a0c10;
    --bg-panel: #141720;
    --bg-panel-border: #232938;
    --bg-card: #1c212d;
    --accent-cyan: #00e5ff;
    --accent-gold: #ffd700;
    --accent-orange: #ff6d00;
    --accent-red: #ff1744;
    --accent-green: #00e676;
    --text-primary: #f0f4f8;
    --text-secondary: #8b9bb4;
    --font-heading: 'Impact', 'Arial Black', sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 50% 10%, rgba(0, 229, 255, 0.08), transparent 45%),
        linear-gradient(180deg, #090b0e 0%, #11141b 100%);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.app-container {
    width: 100%;
    max-width: 1020px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Header */
.gym-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-panel);
    border: 1px solid var(--bg-panel-border);
    border-radius: 12px;
    padding: 10px 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.logo-badge {
    display: flex;
    align-items: center;
    background: #ffffff;
    padding: 3px 8px;
    border-radius: 8px;
    border: 2px solid var(--accent-cyan);
    box-shadow: 0 0 14px rgba(0, 229, 255, 0.45);
}

.brand-logo {
    height: 44px;
    width: auto;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.brand-logo:hover {
    transform: scale(1.04);
}

.header-titles {
    text-align: center;
    flex: 1;
    margin: 0 16px;
}

.game-title {
    font-family: var(--font-heading);
    font-size: 26px;
    letter-spacing: 2px;
    color: #ffffff;
    text-shadow: 0 0 14px rgba(0, 229, 255, 0.4);
}

.accent-text {
    color: var(--accent-cyan);
}

.tagline {
    font-size: 10.5px;
    letter-spacing: 2.5px;
    color: var(--text-secondary);
    margin-top: 2px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: #1e2432;
    border: 1px solid #313a4d;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #2a3346;
    color: #fff;
    border-color: var(--accent-cyan);
}

.btn-icon.active {
    background: rgba(0, 229, 255, 0.12);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

/* Current Exercise Notification Banner */
.exercise-banner {
    width: 100%;
    background: linear-gradient(90deg, rgba(0, 229, 255, 0.08), rgba(255, 215, 0, 0.08), rgba(255, 23, 68, 0.08));
    border: 1px solid rgba(0, 229, 255, 0.25);
    border-radius: 8px;
    padding: 7px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 12.5px;
    font-weight: 600;
}

.badge-live {
    background: var(--accent-cyan);
    color: #000;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
}

.exercise-name {
    font-weight: 700;
    font-size: 13.5px;
    color: var(--accent-cyan);
    letter-spacing: 0.5px;
}

.separator {
    color: var(--text-secondary);
    opacity: 0.6;
}

.exercise-desc {
    color: var(--text-secondary);
    font-size: 12px;
}

/* Main Arena */
.arcade-arena {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 18px;
    width: 100%;
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 200px;
}

.panel-box {
    background: var(--bg-panel);
    border: 1px solid var(--bg-panel-border);
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

.panel-heading {
    font-family: var(--font-heading);
    font-size: 14px;
    letter-spacing: 1.5px;
    color: #ffffff;
    margin-bottom: 6px;
    text-align: center;
}

.panel-sub {
    font-size: 10px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.canvas-wrapper {
    background: #0a0c10;
    border: 1px solid #232938;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    min-height: 105px;
}

/* Stats */
.stat-item {
    margin-top: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.stat-label {
    display: block;
    font-size: 9.5px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 1.5px;
    margin-bottom: 2px;
}

.stat-value-group {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 22px;
    letter-spacing: 1px;
    color: #ffffff;
}

.stat-value.accent {
    color: var(--accent-cyan);
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

.stat-value.pr-gold {
    color: var(--accent-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.stat-unit, .stat-prefix {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-secondary);
}

/* Controls list */
.controls-list {
    list-style: none;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.controls-list li {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.controls-list span {
    margin-left: auto;
    font-size: 10.5px;
    color: #abbcd4;
}

kbd {
    background: #242c3c;
    border: 1px solid #3d4a63;
    border-radius: 4px;
    padding: 2px 5px;
    font-family: monospace;
    font-size: 10px;
    color: #ffffff;
    box-shadow: 0 2px 0 #151a24;
}

/* Center Well & Canvas */
.canvas-center-well {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.canvas-frame {
    position: relative;
    background: #000;
    border: 3px solid #283042;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 229, 255, 0.15);
}

#game-canvas {
    display: block;
    background: #0c0e12;
}

/* Overlays */
.game-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 12, 16, 0.88);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    padding: 20px;
    transition: opacity 0.25s ease;
}

.game-overlay.hidden {
    display: none;
}

.overlay-card {
    background: linear-gradient(145deg, #181d28, #10131a);
    border: 1px solid #333d54;
    border-radius: 14px;
    padding: 24px 20px;
    text-align: center;
    max-width: 310px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8), 0 0 16px rgba(0, 229, 255, 0.2);
}

.card-logo {
    margin-bottom: 12px;
}

.modal-logo {
    height: 48px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.5));
}

.overlay-card h2 {
    font-family: var(--font-heading);
    font-size: 22px;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
    color: #ffffff;
}

.modal-desc {
    font-size: 11.5px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 14px;
}

.equipment-guide {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 16px;
    text-align: left;
    background: rgba(0, 0, 0, 0.35);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.guide-item {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
}

.guide-img {
    height: 20px;
    width: 32px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

.badge {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    text-align: center;
    line-height: 18px;
    font-size: 10px;
    font-weight: 800;
    color: #000;
}

.badge.bar { background: var(--accent-cyan); }
.badge.bell { background: var(--accent-gold); }
.badge.lat { background: #d500f9; color: #fff; }
.badge.rack { background: var(--accent-orange); color: #fff; }
.badge.tread { background: #2979ff; color: #fff; }
.badge.dumb { background: var(--accent-green); }
.badge.bench { background: var(--accent-red); color: #fff; }

.btn-primary {
    background: linear-gradient(135deg, #00e5ff, #0087a3);
    color: #050b14;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-family: var(--font-heading);
    font-size: 16px;
    letter-spacing: 1.5px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 229, 255, 0.4);
    transition: all 0.2s ease;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.6);
}

.btn-primary:active {
    transform: translateY(1px);
}

.pr-badge {
    background: linear-gradient(135deg, #ffd700, #ff8f00);
    color: #000;
    font-family: var(--font-heading);
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    display: inline-block;
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.6);
}

.final-stats {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.final-stat {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.final-stat .val {
    font-family: var(--font-heading);
    font-size: 16px;
    color: #ffffff;
}

/* Mobile Touch Bar */
.mobile-touch-bar {
    display: none; /* active on mobile media query */
    width: 100%;
    max-width: 420px;
    margin-top: 10px;
    justify-content: space-between;
    gap: 12px;
}

.d-pad, .action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.d-pad-vertical {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.touch-btn {
    background: #1c2230;
    border: 1px solid #34405a;
    border-radius: 10px;
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 18px;
    width: 52px;
    height: 52px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

.touch-btn:active {
    background: #2b354c;
    border-color: var(--accent-cyan);
    transform: scale(0.94);
}

.touch-slam {
    font-size: 11px;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #ff1744, #99001e);
    border-color: #ff5252;
}

.touch-action {
    background: linear-gradient(135deg, #00e5ff, #007a8a);
    color: #000;
}

.touch-hold {
    font-size: 11px;
    letter-spacing: 1px;
    background: #2a3144;
}

/* Footer */
.gym-footer {
    width: 100%;
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    padding: 10px 0;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.footer-link {
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 600;
}

.footer-link:hover {
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 820px) {
    .arcade-arena {
        flex-direction: column;
        align-items: center;
    }

    .side-panel {
        width: 100%;
        max-width: 360px;
        flex-direction: row;
        justify-content: space-between;
    }

    .right-panel .controls-guide-box {
        display: none;
    }

    .left-panel .stats-box {
        flex: 1;
    }

    .mobile-touch-bar {
        display: flex;
    }
}

@media (max-width: 580px) {
    .gym-header {
        padding: 8px 10px;
    }

    .game-title {
        font-size: 20px;
        letter-spacing: 1px;
    }

    .tagline {
        font-size: 8.5px;
        letter-spacing: 1.5px;
    }

    .brand-logo {
        height: 36px;
    }

    .btn-icon .btn-label {
        display: none;
    }

    .btn-icon {
        padding: 6px 8px;
        font-size: 14px;
    }

    .exercise-banner {
        font-size: 11px;
        padding: 5px 10px;
        gap: 6px;
    }

    .side-panel {
        max-width: 320px;
    }
}
