@charset "utf-8";
/**
 * 娱乐中心自研小游戏的公共样式底座（iframe 内使用）。
 * 不走 gulp 构建，手写后直接提交；token 值与 style/sass/public/mod/_method.scss 保持一致。
 */

:root{
    --g-bg:        #f4f6fa;
    --g-surface:   #e9edf4;
    --g-text:      #1d1f20;
    --g-divider:   rgba(29,31,32,.16);
    --g-hairline:  rgba(29,31,32,.08);
    --g-muted:     rgba(29,31,32,.55);
    --g-subtle:    rgba(29,31,32,.7);
    --g-accent:    #3576d2;
    --g-accent100: #ecf3fd;
    --g-accent200: #d8e7fb;
    --g-accent300: #b3d0f5;
    --g-accent600: #2b64b8;
    --g-accent700: #22509a;
    --g-accent800: #1c3f77;
    --g-accent900: #16294b;
    --g-neutral100:#f5f5f8;
    --g-neutral200:#e7e7ea;
    --g-neutral300:#d4d4d7;
    --g-neutral800:#424244;
    --g-neutral900:#2b2b2d;
    --g-warm:      #e07b39;
    --g-danger:    #b4472f;
    --g-ok:        #057748;
    --g-font:      ui-sans-serif, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft Yahei", Arial, sans-serif;
    --g-font-head: "Barlow Condensed", var(--g-font);
    --g-font-mono: ui-monospace, Menlo, Consolas, "Courier New", monospace;
}

*{ box-sizing: border-box; }

html, body{
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body{
    background: var(--g-bg);
    color: var(--g-text);
    font: 14px/1.5 var(--g-font);
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

/* — 整体骨架 — */
.g-wrap{
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    padding: 12px 14px 14px;
}

/* — 顶部条：左侧计分，右侧操作 — */
.g-bar{
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}
.g-bar .g-sp{ margin-left: auto; }

.g-stat{
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 62px;
    padding: 4px 10px;
    border: 1px solid var(--g-hairline);
    background: var(--g-surface);
    text-align: center;
}
.g-stat .k{
    font-family: var(--g-font-head);
    font-size: 11px;
    line-height: 14px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--g-muted);
}
.g-stat .v{
    font-family: var(--g-font-head);
    font-weight: 600;
    font-size: 20px;
    line-height: 24px;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}
.g-stat.hot .v{ color: var(--g-accent700); }

/* — 按钮 — */
.g-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid var(--g-accent800);
    background: var(--g-accent800);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.g-btn:hover{ background: var(--g-accent900); border-color: var(--g-accent900); }
.g-btn:active{ transform: translateY(1px); }
.g-btn.ghost{
    background: transparent;
    border-color: var(--g-divider);
    color: var(--g-subtle);
}
.g-btn.ghost:hover{ border-color: var(--g-accent); color: var(--g-accent700); }
.g-btn.on{
    background: var(--g-accent200);
    border-color: var(--g-accent);
    color: var(--g-accent800);
}
.g-btn[disabled]{ opacity: .45; cursor: not-allowed; }
.g-btn.sm{ min-height: 28px; padding: 0 10px; font-size: 12px; }

/* — 分段选择 — */
.g-seg{
    display: inline-flex;
    border: 1px solid var(--g-divider);
    background: #fff;
}
.g-seg button{
    min-height: 32px;
    padding: 0 12px;
    border: 0;
    border-right: 1px solid var(--g-hairline);
    background: transparent;
    color: var(--g-subtle);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}
.g-seg button:last-child{ border-right: 0; }
.g-seg button.on{ background: var(--g-accent800); color: #fff; }

/* — 棋盘 / 画布区 — */
.g-board{
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    border: 1px solid var(--g-divider);
    background: #fff;
}
.g-board canvas{
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
}

/* — 遮罩（开局 / 结算） — */
.g-mask{
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    background: rgba(244,246,250,.93);
    text-align: center;
}
.g-mask[hidden]{ display: none; }
.g-mask h2{
    margin: 0;
    font-family: var(--g-font-head);
    font-weight: 600;
    font-size: 30px;
    line-height: 1.1;
}
.g-mask p{
    margin: 0;
    max-width: 30em;
    font-size: 13px;
    line-height: 20px;
    color: var(--g-subtle);
}
.g-mask .big{
    font-family: var(--g-font-head);
    font-weight: 600;
    font-size: 46px;
    line-height: 1;
    color: var(--g-accent700);
    font-variant-numeric: tabular-nums;
}

/* — 虚拟方向键（窄屏 / 触屏才显示，由 JS 加 .g-touch 到 body） — */
.g-pad{
    display: none;
    flex-shrink: 0;
    grid-template-columns: repeat(3, 56px);
    grid-template-rows: repeat(2, 44px);
    gap: 6px;
    justify-content: center;
}
body.g-touch .g-pad{ display: grid; }
.g-pad button{
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--g-divider);
    background: var(--g-surface);
    color: var(--g-subtle);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
}
.g-pad button:active{ background: var(--g-accent200); border-color: var(--g-accent); }
.g-pad .up{ grid-column: 2; grid-row: 1; }
.g-pad .left{ grid-column: 1; grid-row: 2; }
.g-pad .down{ grid-column: 2; grid-row: 2; }
.g-pad .right{ grid-column: 3; grid-row: 2; }

/* — 提示条 — */
.g-toast{
    position: fixed;
    left: 50%;
    bottom: 22px;
    z-index: 20;
    transform: translateX(-50%) translateY(8px);
    padding: 8px 16px;
    background: var(--g-neutral900);
    color: #fff;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s, transform .18s;
}
.g-toast.show{ opacity: 1; transform: translateX(-50%) translateY(0); }

/* — 小工具 — */
.g-hint{
    flex-shrink: 0;
    margin: 0;
    font-size: 12px;
    line-height: 18px;
    color: var(--g-muted);
}
.g-num{ font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.g-mono{ font-family: var(--g-font-mono); }

@media (max-width: 560px){
    .g-wrap{ padding: 10px; gap: 8px; }
    .g-stat{ min-width: 54px; padding: 3px 8px; }
    .g-stat .v{ font-size: 17px; line-height: 21px; }
    .g-mask h2{ font-size: 24px; }
    .g-mask .big{ font-size: 36px; }
}
