/* ==========================================================================
   枪战小房间 —— 样式
   ========================================================================== */

/* [hidden] 会被同元素的 display 覆盖，统一兜一层（这是本站踩过的坑） */
[hidden] { display: none !important; }

:root {
    --gm-bg:      #0a0f1a;
    --gm-panel:   #121a29;
    --gm-panel-2: #16203252;
    --gm-line:    #23324a;
    --gm-text:    #e8eefb;
    --gm-text-2:  #96a6c0;
    --gm-accent:  #4c8dff;
    --gm-accent-2:#7c5cff;
    --gm-red:     #ff5d73;
    --gm-green:   #34d399;
    --gm-gold:    #fbbf24;
    --gm-radius:  14px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 14px;
    background:
        radial-gradient(1200px 620px at 50% -10%, #1b2a45 0%, transparent 62%),
        radial-gradient(760px 500px at 100% 100%, #1a1636 0%, transparent 60%),
        var(--gm-bg);
    color: var(--gm-text);
    font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
    min-height: 100vh;
}

.gm-wrap {
    max-width: 1360px;
    margin: 0 auto;
}

/* ==========================================================================
   顶栏
   ========================================================================== */
.gm-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: linear-gradient(135deg, #101a2c, #16233a);
    border: 1px solid var(--gm-line);
    border-radius: var(--gm-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

.gm-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.gm-logo {
    font-size: 22px;
    filter: drop-shadow(0 0 10px rgba(76, 141, 255, .6));
}
.gm-brand h1 {
    margin: 0;
    font-size: 18px;
    letter-spacing: .3px;
    white-space: nowrap;
}
.gm-sub {
    font-size: 11.5px;
    color: var(--gm-text-2);
    padding: 3px 9px;
    border: 1px solid var(--gm-line);
    border-radius: 999px;
    white-space: nowrap;
}

.gm-topbar-r {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.gm-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    font-size: 13px;
    color: var(--gm-text);
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--gm-line);
    border-radius: 999px;
    text-decoration: none;
    transition: all .16s ease;
    white-space: nowrap;
}
a.gm-pill:hover {
    background: rgba(76, 141, 255, .16);
    border-color: rgba(76, 141, 255, .5);
    transform: translateY(-1px);
}
.gm-me { border-color: rgba(76, 141, 255, .36); }
.gm-back { border-color: rgba(124, 92, 255, .42); }
.gm-temp {
    font-size: 10.5px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(251, 191, 36, .2);
    color: #fde68a;
}

/* ==========================================================================
   大厅
   ========================================================================== */
.gm-lobby { margin-top: 16px; }

.gm-lobby-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, #121c2e, #0d1626 60%);
    border: 1px solid var(--gm-line);
    border-radius: 20px;
    padding: 32px 28px 26px;
    text-align: center;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .42);
}
.gm-lobby-card::before {
    content: '';
    position: absolute;
    inset: -40% -10% auto -10%;
    height: 240px;
    background: radial-gradient(closest-side, rgba(76, 141, 255, .22), transparent);
    pointer-events: none;
}

.gm-lobby-hero { position: relative; }
.gm-lobby-emoji {
    font-size: 46px;
    line-height: 1;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 18px rgba(255, 93, 115, .5));
}
.gm-lobby-hero h2 {
    margin: 0 0 10px;
    font-size: 23px;
    letter-spacing: .5px;
}
.gm-lobby-hero p {
    margin: 0 auto;
    max-width: 620px;
    font-size: 13.5px;
    line-height: 1.85;
    color: var(--gm-text-2);
}
.gm-lobby-hero b { color: #cfe0ff; }

.gm-seats {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    max-width: 700px;
    margin: 24px auto 0;
}
.gm-seat {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    padding: 13px 10px;
    font-size: 13px;
    background: rgba(255, 255, 255, .035);
    border: 1px dashed var(--gm-line);
    border-radius: 12px;
    color: var(--gm-text-2);
    min-width: 0;
}
.gm-seat.on {
    border-style: solid;
    border-color: rgba(76, 141, 255, .45);
    background: rgba(76, 141, 255, .1);
    color: var(--gm-text);
    font-weight: 600;
}
.gm-seat i {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 10px currentColor;
}
.gm-seat span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gm-lobby-stat {
    margin-top: 16px;
    font-size: 13px;
    color: #8fd8b6;
    min-height: 20px;
}
.gm-lobby-stat.warn { color: #ffb3bd; }

.gm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 34px;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--gm-accent), var(--gm-accent-2));
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: all .18s ease;
    box-shadow: 0 10px 26px rgba(76, 141, 255, .34);
}
.gm-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(76, 141, 255, .44); }
.gm-btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.gm-btn-ghost {
    background: rgba(255, 255, 255, .08);
    border: 1px solid var(--gm-line);
    box-shadow: none;
    padding: 9px 22px;
    font-size: 13px;
}

#gmEnter { margin-top: 20px; }

.gm-keys {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 18px;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--gm-line);
    font-size: 12.5px;
    color: var(--gm-text-2);
}
.gm-keys > div { display: inline-flex; align-items: center; gap: 6px; }
.gm-keys kbd {
    display: inline-block;
    min-width: 24px;
    padding: 2px 7px;
    font: inherit;
    font-size: 11.5px;
    font-weight: 600;
    color: #dce8ff;
    background: rgba(255, 255, 255, .07);
    border: 1px solid var(--gm-line);
    border-bottom-width: 2px;
    border-radius: 6px;
}
.gm-ms { color: #cfe0ff; font-weight: 600; }
.gm-tip {
    margin: 14px 0 0;
    font-size: 12px;
    color: #7b8aa4;
}

/* ==========================================================================
   战场
   ========================================================================== */
.gm-stage { margin-top: 16px; }

.gm-arena {
    position: relative;
    width: 100%;
    max-width: calc((100vh - 178px) * 1.6);
    aspect-ratio: 1280 / 800;
    margin: 0 auto;
    border: 1px solid var(--gm-line);
    border-radius: var(--gm-radius);
    overflow: hidden;
    background: #0b1220;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .5);
    touch-action: none;
    user-select: none;
    cursor: crosshair;
}

#gmCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ---------------- HUD ---------------- */
.gm-hud {
    position: absolute;
    pointer-events: none;
    font-size: 12.5px;
}
.gm-hud-me {
    left: 12px;
    top: 12px;
    padding: 9px 13px 10px;
    min-width: 178px;
    background: rgba(8, 13, 22, .62);
    border: 1px solid rgba(120, 165, 235, .25);
    border-radius: 11px;
    backdrop-filter: blur(6px);
}
.gm-hud-name {
    font-size: 13.5px;
    font-weight: 700;
    margin-bottom: 7px;
    color: #eaf2ff;
}
.gm-hpbar {
    position: relative;
    height: 15px;
    background: rgba(255, 255, 255, .1);
    border-radius: 999px;
    overflow: hidden;
}
.gm-hpbar i {
    display: block;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #34d399, #6ee7b7);
    transition: width .18s ease, background .3s ease;
    border-radius: 999px;
}
.gm-hpbar i.mid { background: linear-gradient(90deg, #fbbf24, #fcd34d); }
.gm-hpbar i.low { background: linear-gradient(90deg, #ef4444, #f87171); }
.gm-hpbar b {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #08121f;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
}
.gm-hud-kd {
    margin-top: 7px;
    font-size: 11.5px;
    color: #9fb3d1;
}

.gm-hud-room {
    right: 12px;
    top: 12px;
    display: flex;
    gap: 7px;
}
.gm-chip {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #d7e5ff;
    background: rgba(8, 13, 22, .62);
    border: 1px solid rgba(120, 165, 235, .25);
    border-radius: 999px;
    backdrop-filter: blur(6px);
}
.gm-chip-warn { color: #ffd0d6; border-color: rgba(255, 93, 115, .5); }

/* ---------------- 排行榜 ---------------- */
.gm-board {
    position: absolute;
    right: 12px;
    bottom: 12px;
    min-width: 176px;
    padding: 9px 11px;
    background: rgba(8, 13, 22, .62);
    border: 1px solid rgba(120, 165, 235, .25);
    border-radius: 11px;
    backdrop-filter: blur(6px);
    pointer-events: none;
}
.gm-board-h {
    font-size: 11.5px;
    color: #9fb3d1;
    margin-bottom: 6px;
    letter-spacing: .5px;
}
.gm-board-r {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    padding: 3px 0;
    min-width: 0;
}
.gm-board-r.me { color: #ffe9a8; font-weight: 700; }
.gm-board-r.down { opacity: .5; }
.gm-board-r i {
    width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
}
.gm-board-n {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gm-board-k { color: #6ee7b7; font-variant-numeric: tabular-nums; width: 18px; text-align: right; }
.gm-board-d { color: #fca5a5; font-variant-numeric: tabular-nums; width: 18px; text-align: right; }

/* ---------------- 死亡遮罩 ---------------- */
.gm-dead {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(6, 10, 18, .72);
    backdrop-filter: blur(3px);
    animation: gm-fade .2s ease;
}
@keyframes gm-fade { from { opacity: 0; } to { opacity: 1; } }
.gm-dead-title {
    font-size: 30px;
    font-weight: 800;
    color: #ff8a9b;
    text-shadow: 0 0 24px rgba(255, 93, 115, .55);
    letter-spacing: 1px;
}
.gm-dead-by { font-size: 14px; color: #cbd8ee; }
.gm-dead-timer { font-size: 13.5px; color: var(--gm-text-2); }
.gm-dead-timer b {
    font-size: 20px;
    color: #fff;
    font-variant-numeric: tabular-nums;
    margin: 0 3px;
}

/* ---------------- 击杀播报 ---------------- */
.gm-feed {
    position: absolute;
    left: 50%;
    top: 64px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}
.gm-feed-i {
    padding: 6px 15px;
    font-size: 12.5px;
    color: #ffe9b8;
    background: rgba(20, 14, 8, .78);
    border: 1px solid rgba(251, 191, 36, .35);
    border-radius: 999px;
    white-space: nowrap;
    animation: gm-pop .22s ease;
    transition: opacity .7s ease, transform .7s ease;
}
.gm-feed-i.out { opacity: 0; transform: translateY(-8px); }
@keyframes gm-pop {
    from { opacity: 0; transform: scale(.9); }
    to   { opacity: 1; transform: scale(1); }
}

/* ---------------- 网络提示 / 退出 ---------------- */
.gm-net {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    padding: 7px 15px;
    font-size: 12.5px;
    color: #ffd7dd;
    background: rgba(60, 12, 22, .82);
    border: 1px solid rgba(255, 93, 115, .5);
    border-radius: 999px;
}
.gm-exit {
    position: absolute;
    left: 12px;
    bottom: 12px;
    padding: 7px 15px;
    font: inherit;
    font-size: 12.5px;
    color: #d7e5ff;
    background: rgba(8, 13, 22, .62);
    border: 1px solid rgba(120, 165, 235, .3);
    border-radius: 999px;
    cursor: pointer;
    transition: all .16s ease;
    backdrop-filter: blur(6px);
}
.gm-exit:hover { background: rgba(255, 93, 115, .22); border-color: rgba(255, 93, 115, .55); }

/* ==========================================================================
   页脚
   ========================================================================== */
.gm-foot {
    margin-top: 16px;
    padding: 14px 4px 26px;
    text-align: center;
    font-size: 12px;
    color: #6d7c95;
    line-height: 1.9;
}
.gm-dot { margin: 0 6px; opacity: .6; }

/* ==========================================================================
   窄屏
   ========================================================================== */
@media (max-width: 900px) {
    .gm-arena { max-width: 100%; }
}
@media (max-width: 620px) {
    body { padding: 9px; }
    .gm-brand h1 { font-size: 15.5px; }
    .gm-sub { display: none; }
    .gm-hide-s { display: none; }
    .gm-lobby-card { padding: 24px 16px 20px; }
    .gm-lobby-hero h2 { font-size: 19px; }
    .gm-lobby-emoji { font-size: 36px; }
    .gm-seats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gm-hud-me { min-width: 132px; padding: 7px 10px 8px; }
    .gm-hud-name { font-size: 12px; }
    .gm-board { min-width: 132px; padding: 7px 9px; }
    .gm-board-n { font-size: 11.5px; }
    .gm-dead-title { font-size: 22px; }
    .gm-keys { gap: 8px 12px; font-size: 11.5px; }
}
