/*
 * Bomberman Arena — stylesheet
 * Tizen 2.4 / Chrome ~34 / WebKit 537 compatible (2014-era browsers)
 *
 * Changes from the modern version:
 *   - All CSS custom properties (var(--x)) replaced with literal values
 *   - inset shorthand → explicit top/right/bottom/left
 *   - backdrop-filter removed (unsupported; panels use solid bg instead)
 *   - clamp() → fixed px values tuned per breakpoint
 *   - min() in width → JS sets .hud width directly via inline style
 *   - display:grid → display:flex for .score-row
 *   - gap on flex containers → margin-based spacing
 *   - fit-content → display:table
 *   - -webkit- prefixes added for gradients, flex, transitions, transforms
 */

* {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    overflow: hidden;
    color: #f4f7f8;
    font-family: "Trebuchet MS", Verdana, sans-serif;
    background: #0b1115;
}

body {
    position: relative;
}

/* ── Screen-size warning (shown only in portrait on very small screens) ── */

.screen-warning {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: none;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    padding: 24px;
    background: #0a1217;
    z-index: 50;
}

.screen-warning-card {
    max-width: 320px;
    padding: 20px 22px;
    border-radius: 24px;
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
    color: #f4f7f8;
    background: rgba(10, 18, 23, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
}

/* ── Game canvas ── */

#arenaCanvas {
    display: block;
    width: 100vw;
    height: 100vh;
}

/* ── HUD column (width is set directly via JS inline style on #hud) ── */

.hud {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 360px; /* default; JS overrides with computed value */
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: stretch;
    -webkit-align-items: stretch;
    align-items: stretch;
    pointer-events: none;
}

/* gap: 12px replaced with margin on subsequent siblings */
.hud > * + * {
    margin-top: 12px;
}

/* ── Shared panel base styles ── */

.brand-card,
.score-row,
.status-panel {
    background: rgba(10, 18, 23, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: 0 28px 74px rgba(0, 0, 0, 0.42);
    -webkit-transition: width 220ms ease, padding 220ms ease, box-shadow 220ms ease;
    transition: width 220ms ease, padding 220ms ease, box-shadow 220ms ease;
}

/* ── Brand card ── */

.brand-card {
    max-width: 100%;
    padding: 18px 20px;
    border-radius: 28px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    flex-direction: column;
    min-height: 222px;
}

.brand-topline {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: start;
    -webkit-align-items: flex-start;
    align-items: flex-start;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
}

/* gap: 12px between topline children */
.brand-topline > * + * {
    margin-left: 12px;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 11px;
    color: #ffb347;
}

.room-badge {
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    padding: 6px 9px;
    border-radius: 100px;
    font-size: 11px;
    line-height: 1;
    color: rgba(223, 231, 231, 0.72);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-card h1 {
    margin: 8px 0 12px;
    font-family: Georgia, "Palatino Linotype", "Book Antiqua", serif;
    /* clamp(26px, 3.3vw, 42px) → fixed value; responsive breakpoints below */
    font-size: 32px;
    line-height: 0.94;
    -webkit-transition: font-size 220ms ease;
    transition: font-size 220ms ease;
}

.status-copy,
.score-row-meta {
    margin: 0;
    color: rgba(223, 231, 231, 0.72);
    line-height: 1.45;
}

/* ── Info ribbon (round + phase pills) ── */

.info-ribbon {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    margin-top: 14px;
}

/* gap: 8px replaced with per-item margin */
.info-ribbon span {
    display: -webkit-inline-box;
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    min-height: 30px;
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #f4f7f8;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-right: 8px;
    margin-bottom: 4px;
}

.info-ribbon span + span {
    color: #7ef0d2;
}

/* ── Status panel ── */

.status-panel {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 22px;
    min-height: 114px;
}

.status-title {
    margin: 8px 0 8px;
    font-family: Georgia, "Palatino Linotype", "Book Antiqua", serif;
    /* clamp(22px, 2.5vw, 32px) → fixed; breakpoints below */
    font-size: 26px;
    line-height: 0.98;
}

/* ── Scoreboard ── */

.scoreboard {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    flex-direction: column;
    width: 100%;
}

/* gap: 8px between rows */
.scoreboard > * + * {
    margin-top: 8px;
}

/* .score-row: was display:grid — replaced with flex */
.score-row {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -webkit-flex-direction: row;
    flex-direction: row;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    padding: 10px 12px;
    border-radius: 18px;
}

.score-row.empty {
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    text-align: center;
}

/* grid-template-columns: auto 1fr auto auto → flex children with margins */
.score-dot {
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 18px currentColor;
    margin-right: 12px;
}

.score-copy {
    -webkit-flex: 1 1 auto;
    flex: 1 1 auto;
    min-width: 0;
    margin-right: 12px;
}

.score-name {
    display: block;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-row-meta {
    font-size: 12px;
}

.score-mode {
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    font-family: Georgia, "Palatino Linotype", "Book Antiqua", serif;
    font-size: 17px;
    color: #7ef0d2;
    white-space: nowrap;
    margin-right: 12px;
}

.score-points {
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    font-family: Georgia, "Palatino Linotype", "Book Antiqua", serif;
    font-size: 27px;
    color: #fff0d5;
    white-space: nowrap;
}

/* ── QR code shell ── */

.qr-shell {
    position: fixed;
    left: 14px;
    bottom: 14px;
    -webkit-transform-origin: bottom left;
    transform-origin: bottom left;
    -webkit-transform: scale(0.8);
    transform: scale(0.8);
}


/* fit-content not widely supported — display:table shrinks to content width */
.rcRoomQrCodeLink {
    display: block;
    -webkit-box-sizing: content-box;
    box-sizing: content-box;
    width: 150px;
    margin-top: 8px;
    margin-right: auto;
    margin-bottom: 8px;
    margin-left: auto;
    border: solid 8px #fff;
    border-radius: 8px;
    color: #fff;
    background-color: #fff;
    box-shadow: 0 0 0 1px #fff;
    text-align: center;
    -webkit-transition: opacity 1s ease;
    transition: opacity 1s ease;
    text-decoration: none;
    -webkit-transform-origin: top left;
    transform-origin: top left;
    -webkit-transform: scale(1);
    transform: scale(1);
}

.rcTechLabel {
    background-color: #000;
    color: #fff;
    font-family: monospace;
    font-size: 13px;
    font-weight: bold;
    margin: 0 0 8px 0;
    padding: 4px;
    letter-spacing: 0.2em;
}

.rcRoomQrCode {
    -webkit-box-sizing: content-box;
    box-sizing: content-box;
    width: 150px;
    height: 150px;
    overflow: hidden;
}

.rcRoomQrCode img,
.rcRoomQrCode canvas {
    display: block;
    width: 150px;
    height: 150px;
}

.rcRoomId {
    background-color: #000;
    color: #fff;
    font-family: monospace;
    font-size: 16px;
    padding: 4px;
    margin: 8px 0 0 0;
    letter-spacing: 0.25em;
}

/* ── Responsive breakpoints ── */

@media (max-width: 980px) {
    .brand-card {
        max-width: 100%;
    }

    .scoreboard {
        width: 100%;
    }
}

@media (max-width: 1000px),
(max-height: 600px) {
    .hud {
        top: 8px;
        left: 8px;
        /* gap: 8px */
    }

    .hud > * + * {
        margin-top: 8px;
    }

    .brand-card,
    .score-row,
    .status-panel {
        box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
    }

    .brand-card {
        padding: 10px 12px;
        border-radius: 18px;
    }

    /* gap: 8px */
    .brand-topline > * + * {
        margin-left: 8px;
    }

    .eyebrow {
        font-size: 9px;
        letter-spacing: 0.16em;
    }

    .room-badge {
        padding: 4px 7px;
        font-size: 9px;
    }

    .brand-card h1 {
        margin: 6px 0 8px;
        /* clamp(17px, 2.1vw, 24px) → 20px */
        font-size: 20px;
    }

    .status-copy,
    .score-row-meta,
    .info-ribbon span {
        font-size: 10px;
        line-height: 1.3;
    }

    .info-ribbon {
        margin-top: 10px;
    }

    /* gap shrinks from 8px to 6px */
    .info-ribbon span {
        min-height: 24px;
        padding: 4px 8px;
        margin-right: 6px;
        margin-bottom: 3px;
    }

    .status-panel {
        margin-top: 10px;
        padding: 10px 12px;
        border-radius: 16px;
        min-height: 96px;
    }

    .status-title {
        margin: 6px 0;
        /* clamp(16px, 2.2vw, 22px) → 19px */
        font-size: 19px;
    }

    /* gap: 6px between score rows */
    .scoreboard > * + * {
        margin-top: 6px;
    }

    /* score-row gap shrinks to 8px */
    .score-dot {
        margin-right: 8px;
    }

    .score-copy {
        margin-right: 8px;
    }

    .score-mode {
        margin-right: 8px;
    }

    .score-row {
        padding: 7px 9px;
        border-radius: 14px;
    }

    .score-name {
        font-size: 12px;
    }

    .score-mode {
        font-size: 12px;
    }

    .score-points {
        font-size: 18px;
    }

    .qr-shell {
        left: 8px;
        bottom: 8px;
        -webkit-transform: scale(0.74);
        transform: scale(0.74);
    }
}

@media (max-width: 760px) {
    .brand-card {
        padding: 14px 16px;
        border-radius: 22px;
    }

    .brand-card h1 {
        /* clamp(20px, 4.2vw, 30px) → 24px */
        font-size: 24px;
    }

    .status-copy,
    .info-ribbon span,
    .score-row-meta {
        font-size: 12px;
    }

    .status-title {
        /* clamp(18px, 3.4vw, 26px) → 22px */
        font-size: 22px;
    }

    .scoreboard {
        width: 100%;
    }

    /* Hide points column on narrow screens; was grid-template-columns: auto 1fr auto */
    .score-points {
        display: none;
    }

    .score-mode {
        margin-right: 0;
    }

    .qr-shell {
        -webkit-transform: scale(0.8);
        transform: scale(0.8);
    }
}

@media (max-width: 700px) and (orientation: portrait) {
    .screen-warning {
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
    }

    #arenaCanvas,
    .hud,
    .qr-shell {
        visibility: hidden;
    }
}
