* { box-sizing: border-box; }

html,
body {
    margin: 0;
    min-height: 100%;
    overscroll-behavior: none;
}

body {
    background:
        radial-gradient(circle at 20% 0%, #252525 0, transparent 35%),
        radial-gradient(circle at 90% 100%, #201b0e 0, transparent 30%),
        #090909;
    color: #f4f4f4;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
    background-size: 40px 40px;
}

.rotate-notice {
    display: none;
}

.app {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 50px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,.10);
    padding-bottom: 22px;
    margin-bottom: 38px;
}

.eyebrow {
    color: #c9a653;
    letter-spacing: .28em;
    font-size: 11px;
    font-weight: 700;
}

h1 {
    margin: 6px 0 0;
    font-size: clamp(24px, 3vw, 38px);
    letter-spacing: .04em;
}

.version {
    border: 1px solid rgba(201,166,83,.45);
    color: #d3b465;
    padding: 9px 12px;
    font-size: 11px;
    letter-spacing: .15em;
}

.hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 40px;
    align-items: end;
    margin-bottom: 30px;
}

.hero-copy > span {
    color: #c9a653;
    font-size: 11px;
    letter-spacing: .18em;
}

.hero-copy h2 {
    margin: 8px 0 8px;
    font-size: clamp(28px, 5vw, 52px);
    line-height: 1;
}

.hero-copy p {
    max-width: 720px;
    margin: 0;
    color: #a8a8a8;
    line-height: 1.65;
}

.controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-card {
    display: grid;
    grid-template-columns: auto auto;
    gap: 5px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.035);
    padding: 12px;
}

.control-card strong {
    grid-column: 1 / -1;
    color: #aaa;
    font-size: 10px;
    letter-spacing: .12em;
    margin-bottom: 4px;
}

.control-card span {
    display: grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    border: 1px solid rgba(255,255,255,.15);
    font-weight: 800;
}

.versus {
    color: #575757;
    font-size: 12px;
    font-weight: 800;
}

.arena-shell {
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.025);
    box-shadow: 0 35px 100px rgba(0,0,0,.45);
}

.mobile-landscape-layout {
    display: block;
}

#game-container {
    width: 100%;
    background: #101010;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#game-container canvas {
    display: block;
    margin: auto;
    max-width: 100%;
    touch-action: none;
}

.mobile-controls {
    display: none;
}

.mobile-btn {
    appearance: none;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.04);
    color: #f6f6f6;
    width: 100%;
    height: 100%;
    cursor: pointer;
    padding: 0;
    transition: transform .08s ease, background .08s ease, border-color .08s ease;
}

.mobile-btn small {
    display: block;
    color: #8d8d8d;
    font-size: 10px;
    letter-spacing: .14em;
    margin-bottom: 8px;
}

.mobile-btn strong {
    font-size: 42px;
    line-height: 1;
    color: #d4b15a;
}

.mobile-btn:active,
.mobile-btn.is-active {
    transform: scale(.98);
    background: rgba(212,177,90,.16);
    border-color: rgba(212,177,90,.50);
}

.arena-footer {
    min-height: 84px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    border-top: 1px solid rgba(255,255,255,.10);
    padding: 16px 24px;
}

.arena-footer > div:last-child {
    text-align: right;
}

.arena-footer small {
    display: block;
    margin-bottom: 3px;
    color: #686868;
    font-size: 9px;
    letter-spacing: .18em;
}

.arena-footer strong {
    font-size: 11px;
    letter-spacing: .12em;
}

#start-button {
    appearance: none;
    border: 1px solid #d0ad57;
    background: #d0ad57;
    color: #101010;
    min-width: 200px;
    min-height: 46px;
    padding: 0 22px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .13em;
    transition: transform .15s ease, background .15s ease;
}

#start-button:hover {
    transform: translateY(-1px);
    background: #e0bf6b;
}

@media (max-width: 980px) and (orientation: portrait) {
    .rotate-notice {
        position: fixed;
        inset: 0;
        display: grid;
        place-items: center;
        padding: 20px;
        background:
            radial-gradient(circle at 50% 0%, #252525 0, transparent 35%),
            #090909;
        z-index: 9999;
    }

    .rotate-card {
        width: min(92vw, 380px);
        border: 1px solid rgba(255,255,255,.10);
        background: rgba(255,255,255,.03);
        padding: 26px 18px;
        text-align: center;
    }

    .rotate-card small {
        display: block;
        color: #c9a653;
        font-size: 11px;
        letter-spacing: .18em;
        margin-bottom: 14px;
    }

    .rotate-card strong {
        display: block;
        font-size: 26px;
        margin-bottom: 10px;
    }

    .rotate-card span {
        color: #9c9c9c;
        line-height: 1.6;
        font-size: 14px;
    }

    .app {
        visibility: hidden;
        pointer-events: none;
    }
}

@media (max-width: 980px) and (orientation: landscape) {
    html,
    body {
        height: 100%;
        overflow: hidden;
    }

    body::before {
        background-size: 28px 28px;
    }

    .app {
        width: 100vw;
        height: 100vh;
        padding: 0;
        display: flex;
        flex-direction: column;
    }

    .topbar {
        margin: 0;
        padding: 8px 12px;
        min-height: 56px;
        border-bottom: 1px solid rgba(255,255,255,.08);
        flex: 0 0 auto;
    }

    .topbar h1 {
        font-size: 22px;
        margin-top: 4px;
    }

    .eyebrow {
        font-size: 9px;
    }

    .version {
        padding: 6px 8px;
        font-size: 10px;
    }

    main {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .hero {
        display: none;
    }

    .arena-shell {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        min-height: 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
    }

    .mobile-landscape-layout {
        flex: 1 1 auto;
        min-height: 0;
        display: grid;
        grid-template-columns: 84px 1fr 84px;
        align-items: stretch;
    }

    .mobile-controls {
        display: grid;
        grid-template-rows: 1fr 1fr;
        gap: 0;
        min-height: 0;
        background: rgba(255,255,255,.02);
    }

    .mobile-controls-left {
        border-right: 1px solid rgba(255,255,255,.08);
    }

    .mobile-controls-right {
        border-left: 1px solid rgba(255,255,255,.08);
    }

    .mobile-btn {
        border: 0;
        border-bottom: 1px solid rgba(255,255,255,.08);
        border-radius: 0;
    }

    .mobile-controls .mobile-btn:last-child {
        border-bottom: 0;
    }

    .mobile-btn strong {
        font-size: 34px;
    }

    .mobile-btn small {
        font-size: 8px;
        margin-bottom: 6px;
    }

    #game-container {
        min-height: 0;
        height: 100%;
    }

    #game-container canvas {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain;
    }

    .arena-footer {
        flex: 0 0 auto;
        grid-template-columns: auto 1fr auto;
        min-height: 58px;
        padding: 8px 12px;
        gap: 12px;
        border-top: 1px solid rgba(255,255,255,.08);
    }

    .arena-footer small {
        font-size: 8px;
    }

    .arena-footer strong {
        font-size: 10px;
    }

    #start-button {
        width: 100%;
        min-width: 0;
        min-height: 40px;
        font-size: 10px;
    }
}

@media (max-width: 760px) and (orientation: portrait) {
    .app {
        width: min(100% - 16px, 1240px);
        padding: 14px 0 24px;
    }
}


/* ==========================================================================
   BARBER ARENA V0.0.7.1
   HOTFIX MOBILE FULLSCREEN
   ========================================================================== */

@media (max-width: 980px) and (orientation: landscape) {
    html,
    body {
        width: 100%;
        height: 100%;
        min-height: 100%;
        margin: 0;
        padding: 0;
        overflow: hidden;
        background: #090909;
    }

    body::before {
        display: none;
    }

    .rotate-notice {
        display: none !important;
    }

    .app {
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        margin: 0;
        padding: 0;
        overflow: hidden;
    }

    /* No title, no marketing copy, no header on mobile gameplay. */
    .topbar,
    .hero {
        display: none !important;
    }

    main {
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        margin: 0;
        padding: 0;
        overflow: hidden;
    }

    .arena-shell {
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
        overflow: hidden;
        background: #090909;
    }

    .mobile-landscape-layout {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        min-height: 0;
        display: grid;
        grid-template-columns: 86px minmax(0, 1fr) 86px;
        grid-template-rows: minmax(0, 1fr);
        overflow: hidden;
    }

    .mobile-controls {
        display: grid !important;
        grid-template-rows: 1fr 1fr;
        height: 100%;
        min-height: 0;
        z-index: 20;
        background: #0c0c0c;
    }

    .mobile-controls-left {
        border-right: 1px solid rgba(255,255,255,.10);
    }

    .mobile-controls-right {
        border-left: 1px solid rgba(255,255,255,.10);
    }

    .mobile-btn {
        min-width: 0;
        min-height: 0;
        border: 0;
        border-bottom: 1px solid rgba(255,255,255,.10);
        border-radius: 0;
        touch-action: none;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-controls .mobile-btn:last-child {
        border-bottom: 0;
    }

    .mobile-btn small {
        font-size: 8px;
        margin-bottom: 4px;
    }

    .mobile-btn strong {
        font-size: clamp(30px, 8vh, 52px);
    }

    #game-container {
        position: relative;
        width: 100%;
        height: 100%;
        min-width: 0;
        min-height: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        background: #101010;
    }

    #game-container canvas {
        display: block;
        width: auto !important;
        height: auto !important;
        max-width: 100% !important;
        max-height: 100% !important;
        margin: 0 !important;
        object-fit: contain;
    }

    /* Footer no longer consumes vertical space. Only the Start button remains. */
    .arena-footer {
        position: fixed;
        left: 98px;
        right: 98px;
        bottom: max(10px, env(safe-area-inset-bottom));
        z-index: 200;
        min-height: 0;
        margin: 0;
        padding: 0;
        border: 0;
        background: transparent;
        display: flex;
        align-items: center;
        justify-content: center;
        pointer-events: none;
    }

    .arena-footer > div {
        display: none !important;
    }

    #start-button {
        pointer-events: auto;
        display: block !important;
        width: min(320px, 54vw);
        min-width: 180px;
        min-height: 44px;
        margin: 0;
        padding: 0 18px;
        border: 1px solid #d0ad57;
        background: #d0ad57;
        color: #101010;
        font-size: 11px;
        font-weight: 900;
        letter-spacing: .13em;
        box-shadow: 0 10px 32px rgba(0,0,0,.42);
        transform: none !important;
    }

    #start-button:hover {
        transform: none !important;
    }
}


/* ==========================================================================
   BARBER ARENA V0.0.7.2
   START SCREEN + COUNTDOWN MOBILE
   ========================================================================== */

.mobile-start-overlay {
    display: none;
}

@media (max-width: 980px) and (orientation: landscape) {
    /*
     * Footer is fully removed from mobile gameplay.
     * Start/restart now lives in a dedicated pre-game overlay.
     */
    .arena-footer {
        display: none !important;
    }

    .mobile-start-overlay {
        position: absolute;
        inset: 0 86px 0 86px;
        z-index: 180;
        display: grid;
        place-items: center;
        pointer-events: none;
        background: rgba(9,9,9,.28);
    }

    .mobile-start-overlay.is-hidden {
        display: none !important;
    }

    .mobile-start-panel {
        display: grid;
        place-items: center;
        gap: 12px;
        width: min(360px, 70%);
        text-align: center;
        pointer-events: auto;
    }

    .mobile-start-label {
        color: #8a8a8a;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: .20em;
    }

    .mobile-start-button {
        appearance: none;
        width: min(320px, 100%);
        min-height: 52px;
        padding: 0 24px;
        border: 1px solid #d0ad57;
        background: #d0ad57;
        color: #101010;
        font-size: 12px;
        font-weight: 900;
        letter-spacing: .14em;
        cursor: pointer;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        box-shadow: 0 14px 40px rgba(0,0,0,.38);
    }

    .mobile-start-button:active {
        transform: scale(.985);
    }

    .mobile-countdown {
        display: none;
        min-width: 120px;
        color: #ffffff;
        font-size: clamp(72px, 22vh, 150px);
        line-height: .9;
        font-weight: 900;
        letter-spacing: -.04em;
        text-shadow: 0 12px 38px rgba(0,0,0,.65);
    }

    .mobile-start-overlay.is-counting {
        background: rgba(9,9,9,.18);
    }

    .mobile-start-overlay.is-counting .mobile-start-label,
    .mobile-start-overlay.is-counting .mobile-start-button {
        display: none;
    }

    .mobile-start-overlay.is-counting .mobile-countdown {
        display: block;
        animation: barberCountdownPop .72s cubic-bezier(.2,.8,.2,1);
    }

    .mobile-countdown.is-go {
        color: #d0ad57;
        font-size: clamp(56px, 17vh, 118px);
        letter-spacing: .04em;
    }

    @keyframes barberCountdownPop {
        0% {
            transform: scale(.72);
            opacity: 0;
        }
        28% {
            transform: scale(1.08);
            opacity: 1;
        }
        100% {
            transform: scale(1);
            opacity: 1;
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .mobile-countdown {
            animation: none !important;
        }
    }
}
