/* ============================================================
 *  基础样式
 * ============================================================ */
*{ box-sizing:border-box; }
html,body{ height:100%; margin:0; padding:0; }
body{
    background:radial-gradient(circle at 50% 0%,#2a3242 0%,#12171f 75%);
    color:#e8eef7;
    font-family:"PingFang SC","Microsoft YaHei","Hiragino Sans GB",system-ui,-apple-system,"Segoe UI",sans-serif;
    overflow:hidden;
    -webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; user-select:none;
    -webkit-tap-highlight-color:transparent;
}
#app{ display:flex; flex-direction:column; height:100vh; height:100dvh; }

/* ============================================================
 *  顶部单行信息栏
 * ============================================================ */
#topbar{
    flex:0 0 auto;
    display:flex; align-items:center; gap:6px;
    padding:5px 10px;
    background:linear-gradient(180deg,#2b3446 0%,#1f2735 100%);
    border-bottom:1px solid #39445a;
    box-shadow:0 2px 14px rgba(0,0,0,.45);
    overflow-x:auto; overflow-y:hidden;
    white-space:nowrap;
    scrollbar-width:none;
    z-index:30;
}
#topbar::-webkit-scrollbar{ display:none; }
#topbar > *{ flex:0 0 auto; }

.tb-brand{
    font-weight:800; font-size:15px; letter-spacing:.5px;
    color:#ffd166; padding-right:6px; text-shadow:0 1px 0 rgba(0,0,0,.4);
}
.tb-brand .sub{ font-size:11px; color:#8798ae; font-weight:400; margin-left:4px; }

.tb-chip{
    display:inline-flex; align-items:center; gap:4px;
    padding:3px 10px; border-radius:999px;
    background:rgba(255,255,255,.055);
    border:1px solid rgba(255,255,255,.08);
    font-size:13px; color:#9fb0c7; line-height:1.6;
    transition:background .2s,border-color .2s,transform .15s;
}
.tb-chip b{ color:#ffe9a8; font-weight:700; font-family:Consolas,"Courier New",monospace; }
.tb-chip.combo{ border-color:rgba(247,183,51,.25); }
.tb-chip.combo.on{
    background:rgba(247,183,51,.18);
    border-color:rgba(247,183,51,.6);
    color:#ffd166;
    animation:comboPulse .55s ease;
}
@keyframes comboPulse{ 0%{transform:scale(1)} 45%{transform:scale(1.16)} 100%{transform:scale(1)} }

.tb-time{
    display:flex; align-items:center; gap:6px;
    font-family:Consolas,"Courier New",monospace; font-size:13px; color:#9fb0c7;
}
.tb-bar{ width:72px; height:7px; border-radius:4px; background:rgba(255,255,255,.1); overflow:hidden; }
.tb-bar i{
    display:block; height:100%; width:100%;
    background:linear-gradient(90deg,#3ecf8e,#8ee06a);
    border-radius:4px;
    transition:width .2s linear, background .35s;
}
.tb-bar.warn i{ background:linear-gradient(90deg,#ff8a3d,#ff5d5d); }

.tb-btn{
    padding:4px 13px; border-radius:999px;
    border:1px solid rgba(255,209,102,.35);
    background:rgba(255,209,102,.1);
    color:#ffd166; font-size:13px; cursor:pointer;
    transition:background .2s,transform .12s;
    outline:none;
}
.tb-btn:hover{ background:rgba(255,209,102,.24); }
.tb-btn:active{ transform:scale(.94); }
.tb-btn.ghost{ border-color:rgba(255,255,255,.18); background:rgba(255,255,255,.06); color:#c3cfdf; }
.tb-btn.ghost:hover{ background:rgba(255,255,255,.14); }
.tb-sep{ width:1px; height:20px; background:rgba(255,255,255,.1); margin:0 2px; }

/* ============================================================
 *  画布区
 * ============================================================ */
#stage{
    position:relative; flex:1 1 auto; min-height:0; overflow:hidden;
    background:#1a1f2a;
}
#game{ display:block; width:100%; height:100%; }
#softInput{
    position:absolute; left:0; bottom:0; width:1px; height:1px;
    opacity:0; border:0; padding:0; z-index:5;
}

/* ============================================================
 *  遮罩层
 * ============================================================ */
.overlay{
    position:absolute; inset:0;
    display:flex; align-items:center; justify-content:center;
    background:rgba(10,14,20,.82);
    -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
    z-index:20; padding:14px;
    animation:fadeIn .3s ease;
}
.overlay.hide{ display:none; }
@keyframes fadeIn{ from{opacity:0} to{opacity:1} }

.ov-card{
    background:linear-gradient(180deg,#2b3446,#1d2431);
    border:1px solid rgba(255,209,102,.22);
    border-radius:18px;
    padding:22px 26px;
    text-align:center;
    max-width:600px; width:100%;
    max-height:96%; overflow-y:auto;
    box-shadow:0 26px 70px rgba(0,0,0,.68), inset 0 1px 0 rgba(255,255,255,.06);
    animation:popIn .38s cubic-bezier(.2,1.4,.5,1);
}
.ov-card::-webkit-scrollbar{ width:6px; }
.ov-card::-webkit-scrollbar-thumb{ background:rgba(255,255,255,.15); border-radius:3px; }
@keyframes popIn{ from{opacity:0;transform:scale(.86) translateY(18px)} to{opacity:1;transform:none} }

.ov-card h1{ font-size:24px; margin:0 0 4px; color:#ffd166; font-weight:800; letter-spacing:1px; }
.ov-card .ov-sub{ color:#8b9bb2; font-size:13px; margin:0 0 14px; }

.ov-sec{ margin:13px 0 15px; text-align:left; }
.ov-label{
    font-size:12px; color:#7d8da3; margin-bottom:7px;
    letter-spacing:1px; font-weight:700;
}
.ov-seg{ display:flex; gap:7px; }
.ov-seg .seg-btn{
    flex:1; padding:8px 4px; border-radius:10px;
    border:1px solid rgba(255,255,255,.13);
    background:rgba(255,255,255,.055);
    color:#b9c6d8; font-size:13px; cursor:pointer;
    transition:all .18s; outline:none; white-space:nowrap;
}
.ov-seg .seg-btn small{ display:block; font-size:10.5px; color:#7d8da3; margin-top:2px; }
.ov-seg .seg-btn:hover{ background:rgba(255,255,255,.12); }
.ov-seg .seg-btn.active{
    background:linear-gradient(180deg,#ffd166,#f0a53c);
    border-color:#f0a53c; color:#33210a; font-weight:800;
    box-shadow:0 4px 14px rgba(240,165,60,.34);
}
.ov-seg .seg-btn.active small{ color:rgba(51,33,10,.65); font-weight:600; }

/* 店铺卡片网格 */
.shop-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:7px;
}
.shop-card{
    display:flex; flex-direction:column; align-items:center; gap:2px;
    padding:8px 4px;
    border-radius:11px;
    border:1px solid rgba(255,255,255,.12);
    background:rgba(255,255,255,.05);
    color:#b9c6d8; cursor:pointer;
    transition:all .18s;
    outline:none;
}
.shop-card:hover{ background:rgba(255,255,255,.11); }
.shop-card.active{
    background:linear-gradient(180deg,rgba(255,209,102,.24),rgba(240,165,60,.16));
    border-color:rgba(255,209,102,.8);
    color:#ffd166;
    box-shadow:0 4px 16px rgba(240,165,60,.25);
}
.shop-card .sc-emoji{ font-size:19px; line-height:1; }
.shop-card .sc-name{ font-size:12px; font-weight:700; }
.shop-card .sc-desc{ font-size:9.5px; color:#7d8da3; text-align:center; line-height:1.25; }
.shop-card.active .sc-desc{ color:rgba(255,209,102,.7); }

.ov-btn{
    display:inline-block; padding:12px 34px; border:none; border-radius:999px;
    font-size:16px; font-weight:800; letter-spacing:1px; cursor:pointer;
    background:linear-gradient(180deg,#ffd166,#f0a53c);
    color:#33210a;
    box-shadow:0 8px 22px rgba(240,165,60,.4), inset 0 1px 0 rgba(255,255,255,.5);
    transition:transform .14s, box-shadow .2s;
    outline:none; text-decoration:none;
}
.ov-btn:hover{ transform:translateY(-2px); box-shadow:0 12px 28px rgba(240,165,60,.55); color:#33210a; text-decoration:none; }
.ov-btn:active{ transform:translateY(0) scale(.97); }
.ov-btn:disabled{ opacity:.5; cursor:wait; transform:none; }

/* 次要按钮：用于"更多游戏"入口 */
.ov-btn-secondary{
    background:linear-gradient(180deg,#4a5568,#2d3748);
    color:#e2e8f0;
    box-shadow:0 8px 22px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.14);
}
.ov-btn-secondary:hover{
    background:linear-gradient(180deg,#5a6578,#3d4758);
    color:#fff;
    box-shadow:0 12px 28px rgba(0,0,0,.42);
}

.ov-btn-row{
    display:flex; gap:10px; justify-content:center; align-items:center;
    flex-wrap:wrap; margin-top:8px;
}

.ov-tip{ font-size:12px; color:#7d8da3; margin-top:12px; }
.ov-tip kbd{
    background:rgba(255,255,255,.1); border-radius:4px; padding:1px 6px;
    font-family:Consolas,monospace; color:#c3cfdf; border:1px solid rgba(255,255,255,.12);
}

/* 结算统计 */
.ov-stats{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:12px 0 10px; }
.ov-stat{
    background:rgba(255,255,255,.05);
    border:1px solid rgba(255,255,255,.08);
    border-radius:12px; padding:9px 5px;
    transition:background .2s;
}
.ov-stat:hover{ background:rgba(255,255,255,.09); }
.ov-stat .v{ font-family:Consolas,monospace; font-size:18px; font-weight:800; color:#ffe9a8; display:block; }
.ov-stat .k{ font-size:11px; color:#8798ae; margin-top:2px; display:block; }
.ov-stat .k .glyphicon{ margin-right:3px; }

/* 顾客头像照片墙 */
.photo-wrap{
    margin:12px 0 6px;
    padding:11px 10px 9px;
    border-radius:12px;
    background:rgba(255,255,255,.05);
    border:1px dashed rgba(255,209,102,.28);
    position:relative;
}
.photo-title{
    font-size:11.5px; color:#8b9bb2; margin-bottom:8px; letter-spacing:.5px;
}
.photo-title .glyphicon{ margin-right:4px; color:#ffd166; }
.photo-grid{
    display:flex; flex-wrap:wrap; gap:3px; justify-content:center;
    max-height:118px; overflow:hidden;
}
.pg-face{
    font-size:20px; line-height:1;
    animation:faceIn .45s cubic-bezier(.2,1.4,.5,1) backwards;
}
@keyframes faceIn{
    from{ opacity:0; transform:scale(0) rotate(-40deg); }
    to{ opacity:1; transform:scale(1) rotate(0); }
}
.pg-more{
    font-size:11px; color:#ffd166; align-self:center;
    padding:2px 7px; border-radius:999px;
    background:rgba(255,209,102,.14);
    border:1px solid rgba(255,209,102,.3);
}

/* 打字建议 */
.advice-box{
    margin:10px 0 14px;
    padding:11px 14px;
    border-radius:12px;
    background:rgba(255,209,102,.07);
    border:1px solid rgba(255,209,102,.18);
    text-align:left;
}
.advice-box .adv-title{
    font-size:12px; color:#ffd166; font-weight:700;
    margin-bottom:6px; letter-spacing:.5px;
}
.advice-box .adv-title .glyphicon{ margin-right:4px; }
.advice-box ul{ margin:0; padding-left:16px; }
.advice-box li{
    font-size:12.5px; color:#b9c6d8; line-height:1.75;
}

.ov-best{
    font-size:12.5px; color:#8b9bb2; margin-bottom:12px;
    padding:8px 12px; border-radius:10px;
    background:rgba(255,209,102,.07);
    border:1px dashed rgba(255,209,102,.22);
}
.ov-best b{ color:#ffd166; }

/* 闪光特效 */
.photo-flash{
    position:absolute; inset:0; background:#fff; z-index:40;
    animation:photoFlash .65s ease-out forwards;
    pointer-events:none;
}
@keyframes photoFlash{
    0%{ opacity:0; }
    8%{ opacity:.96; }
    100%{ opacity:0; }
}

/* ============================================================
 *  模态框
 * ============================================================ */
.modal-content{
    background:linear-gradient(180deg,#2b3446,#1e2532);
    border:1px solid rgba(255,209,102,.2);
    border-radius:14px; color:#dbe4f0;
    box-shadow:0 26px 70px rgba(0,0,0,.7);
}
.modal-header{ border-bottom:1px solid rgba(255,255,255,.09); padding:14px 18px; }
.modal-footer{ border-top:1px solid rgba(255,255,255,.09); padding:12px 18px; }
.modal-title{ color:#ffd166; font-weight:800; font-size:16px; }
.modal-title .glyphicon{ margin-right:5px; }
.modal-header .close{ color:#9fb0c7; opacity:.8; text-shadow:none; }
.modal-header .close:hover{ color:#fff; opacity:1; }
.modal-body{ padding:16px 20px; font-size:13.5px; line-height:1.85; color:#b9c6d8; }
.modal-body h5{ color:#ffd166; font-size:14px; font-weight:700; margin:16px 0 6px; }
.modal-body h5:first-child{ margin-top:0; }
.modal-body h5 .glyphicon{ margin-right:5px; }
.modal-body ul{ padding-left:20px; margin:0; }
.modal-body li{ margin:3px 0; }
.modal-body .hl{ color:#ffe9a8; font-weight:700; }
.modal-body .grn{ color:#4bd68a; font-weight:700; }
.modal-body .org{ color:#ff9b3d; font-weight:700; }
.modal-body .ylw{ color:#ffd166; font-weight:700; }

.set-row{
    display:flex; align-items:center; justify-content:space-between;
    padding:9px 0; border-bottom:1px dashed rgba(255,255,255,.08);
}
.set-row:last-child{ border-bottom:none; }
.set-row .lab{ font-size:13.5px; color:#c3cfdf; }
.set-row .lab small{ display:block; color:#7d8da3; font-size:11px; margin-top:1px; }

.btn-group .btn-default{
    background:rgba(255,255,255,.06); border-color:rgba(255,255,255,.14);
    color:#b9c6d8; font-size:12.5px;
}
.btn-group .btn-default:hover{ background:rgba(255,255,255,.13); color:#fff; }
.btn-group .btn-default.active{
    background:linear-gradient(180deg,#ffd166,#f0a53c);
    border-color:#f0a53c; color:#33210a; font-weight:700;
    box-shadow:none;
}
.btn-warning{
    background:linear-gradient(180deg,#ffd166,#f0a53c);
    border-color:#f0a53c; color:#33210a; font-weight:700;
}
.btn-warning:hover{ background:linear-gradient(180deg,#ffdd88,#f5b352); color:#33210a; }

.sr-only{
    position:absolute; width:1px; height:1px; padding:0; margin:-1px;
    overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

@media (max-width:640px){
    .tb-brand .sub{ display:none; }
    .tb-chip{ padding:3px 7px; font-size:12px; }
    .tb-bar{ width:44px; }
    .ov-card{ padding:18px 15px; border-radius:14px; }
    .ov-card h1{ font-size:19px; }
    .ov-stats{ grid-template-columns:repeat(2,1fr); }
    .ov-seg .seg-btn{ font-size:11.5px; padding:7px 2px; }
    .shop-grid{ grid-template-columns:repeat(3,1fr); gap:5px; }
    .shop-card{ padding:6px 2px; }
    .shop-card .sc-emoji{ font-size:17px; }
    .shop-card .sc-name{ font-size:11px; }
    .shop-card .sc-desc{ display:none; }
    .photo-grid{ max-height:96px; }
    .pg-face{ font-size:17px; }
    .ov-btn{ padding:11px 24px; font-size:15px; }
}