:root{color-scheme:light;--page:#f6f7fc;--white:#fff;--pink:#ff5f9e;--pale-pink:#fff0f6;--ink:#15172f;--muted:#777b91;--lavender:#eeeaff;--green:#188c73;--radius:20px;font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","SF Pro Display","Microsoft YaHei",sans-serif;color:var(--ink);font-synthesis:none}
*{box-sizing:border-box}body{margin:0;background:var(--page)}html{overflow-x:clip;scrollbar-gutter:stable}button,input{font:inherit;color:inherit}button{cursor:pointer;border:0;background:none;-webkit-tap-highlight-color:transparent}button:disabled{cursor:not-allowed}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #af98e9;outline-offset:3px}button:active:not(:disabled){transform:scale(.98)}button{transition:background .15s,transform .12s}img{display:block;max-width:100%}[hidden]{display:none!important}.app-shell{max-width:480px;min-height:100dvh;margin:auto;background:linear-gradient(145deg,#f8f9fd,#f3f3fd 65%,#f6f8ff)}.page-header{position:sticky;top:0;z-index:5;padding:env(safe-area-inset-top) 12px 0;height:calc(62px + env(safe-area-inset-top));display:grid;grid-template-columns:44px 1fr 44px;align-items:center;background:#f8f9fef5;backdrop-filter:blur(16px)}h1{margin:0;text-align:center;font-size:21px;font-weight:750;line-height:1.3}h2{font-size:21px;margin:0;font-weight:750}.icon-button{width:44px;height:44px;display:flex;align-items:center;justify-content:center;padding:10px}.icon{width:24px;height:24px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}.icon.small{width:16px;height:16px}.preview-label{font-size:12px;text-align:center;background:#fff0f6;color:#b02f69;padding:5px 12px}.content{padding:10px 16px calc(28px + env(safe-area-inset-bottom))}.surface{background:var(--white);border-radius:var(--radius)}.coin-bar{height:62px;padding:10px 14px;display:flex;align-items:center;gap:12px;border-radius:19px;background:var(--white)}.coin-icon{width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:white;background:var(--pink);flex-shrink:0}.coin-icon .icon{width:24px;height:24px}.coin-label{font-weight:650;font-size:15px;white-space:nowrap}.coin-value{font-size:24px;font-weight:750;font-variant-numeric:tabular-nums;margin-left:auto;white-space:nowrap}.coin-value.unknown{font-size:14px;font-weight:500;color:var(--muted)}.pill{height:36px;padding:0 18px;display:inline-flex;align-items:center;justify-content:center;border-radius:15px;color:#ed3d88;background:var(--pale-pink);font-size:15px;font-weight:600}.search-row{display:flex;gap:12px;margin:14px 0}.select-shop{display:flex;align-items:center;gap:6px;justify-content:space-between;min-width:116px;max-width:46%;height:44px;border-radius:17px;background:white;padding:0 12px;font-weight:600;font-size:14px}.select-shop span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.search{display:flex;align-items:center;gap:6px;flex:1;min-width:0;border-radius:17px;background:#ffffffb8;padding:0 12px;color:var(--muted);height:44px}.search .icon{width:20px;height:20px}.search input{min-width:0;width:100%;border:0;outline:0;background:transparent;box-shadow:none;font-size:14px;height:100%;padding:0;-webkit-appearance:none}.search input::placeholder{color:#8c90a5}.filters{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:14px}.filter{height:48px;background:#fff9;border-radius:16px;display:flex;align-items:center;justify-content:center;gap:5px;font-weight:600;font-size:14px}.filter.selected{background:#ffeaf4;color:#ee428b}.filter.pending{flex-direction:column;gap:1px;color:#85869a;font-weight:500}.filter small{font-size:11px}.machine-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.machine-card{position:relative;display:block;background:white;border-radius:20px;overflow:hidden;padding:10px 12px 14px;text-align:left;min-width:0;width:100%}.machine-card .machine-image{height:190px;width:100%;object-fit:contain;background:#fff}.status-badge{display:inline-flex;align-items:center;gap:5px;border-radius:20px;font-size:12px;font-weight:600;white-space:nowrap;color:var(--green)}.machine-card .status-badge{position:absolute;left:10px;top:10px;background:#28a486;color:white;padding:5px 10px;z-index:1}.machine-card .status-playing,.machine-card .status-reserved{background:#9c8be2}.machine-card .status-offline,.machine-card .status-maintenance,.machine-card .status-unknown{background:#a5a8b8}.status-badge:not(.machine-card .status-badge)::before{content:'';width:8px;height:8px;border-radius:50%;background:currentColor}.status-playing,.status-reserved{color:#987acc}.status-offline,.status-maintenance,.status-unknown{color:var(--muted)}.machine-card h3{font-size:16px;line-height:1.45;font-weight:700;margin:4px 0 1px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.machine-code{font-size:12px;line-height:1.5;color:var(--muted);margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.prize-max{font-size:13px;line-height:1.5;color:#f14991;margin:4px 0 0}.empty{grid-column:1/-1;background:white;border-radius:22px;padding:48px 20px;text-align:center;color:var(--muted);font-size:14px}.empty h2{font-size:18px;color:var(--ink);margin:16px 0 8px}.empty .icon{width:42px;height:42px;color:#b7b3d2}.empty p{line-height:1.6;margin:8px 0 20px}.empty button{margin-top:4px}.image-empty{width:100%;height:190px;display:flex;align-items:center;justify-content:center;background:#f9f9fd;color:#c4bfdc;border-radius:14px}.image-empty .icon{width:55px;height:55px}.skeleton{height:284px;border-radius:20px;background:linear-gradient(100deg,#fff 20%,#eeeff7 45%,#fff 70%);background-size:300% 100%;animation:shine 1.5s infinite}.detail{padding-top:8px}.detail-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 2px 12px}.detail-heading h2{font-size:20px;line-height:1.35;margin:0 0 2px}.detail-heading>div{min-width:0}.video-frame{position:relative;width:100%;aspect-ratio:1;border-radius:20px;overflow:hidden;background:#eeedf7}.video-frame img{width:100%;height:100%;object-fit:cover}.video-frame .preview-tag{position:absolute;left:12px;top:12px;border-radius:20px;background:#52506870;padding:4px 10px;color:white;font-size:11px}.video-unavailable{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;color:#878397;background:linear-gradient(135deg,#eeeafa,#f8f8fc)}.video-unavailable .icon{width:48px;height:48px;color:#b7aed2}.video-unavailable strong{font-size:17px;font-weight:600}.prizes{padding:14px;margin-top:12px;background:white;border-radius:20px}.section-title{font-size:16px;font-weight:700;margin:0 0 10px}.prize-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.prize-item{padding:0;min-width:0;text-align:center}.prize-item img{width:100%;aspect-ratio:1;object-fit:contain;border-radius:14px;background:#fafafd}.prize-item .image-empty{height:auto;aspect-ratio:1}.prize-item strong{font-size:13px;line-height:1.45;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600;margin-top:5px}.prize-item p{font-size:13px;color:#ef408b;margin:3px 0 0}.prize-empty{font-size:14px;color:var(--muted);padding:8px 0}.detail .coin-bar{margin-top:12px;height:58px}.package-row{width:100%;height:48px;padding:0 15px;margin-top:10px;border-radius:17px;background:white;display:flex;align-items:center;gap:6px;font-size:15px;font-weight:600}.package-row .amount{margin-left:auto}.package-row .pending-text{color:var(--muted);font-size:13px;font-weight:500}.detail.before-play{padding-bottom:calc(104px + env(safe-area-inset-bottom))}.bottom-action{position:fixed;z-index:4;bottom:0;width:100%;max-width:480px;left:50%;transform:translateX(-50%);padding:12px 16px calc(16px + env(safe-area-inset-bottom));background:linear-gradient(180deg,#f6f7fc00,#f6f7fc 20%)}.primary{width:100%;height:50px;padding:0 16px;background:var(--pink);color:white;border-radius:17px;font-size:17px;line-height:1;font-weight:700;display:flex;align-items:center;justify-content:center}.primary:disabled{background:#e6d4df;color:#85727d}.secondary{height:44px;min-width:100px;color:var(--muted);font-size:15px}.control-deck{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:20px 14px;margin-top:12px;background:white;border-radius:22px;min-height:215px}.dpad{display:grid;grid-template-columns:repeat(3,54px);grid-template-rows:repeat(3,54px);gap:6px}.direction{background:#ebe5ff;border-radius:18px;display:flex;align-items:center;justify-content:center;touch-action:none;user-select:none}.direction .icon{width:28px;height:28px;stroke-width:2.3}.direction[data-direction=up]{grid-column:2;grid-row:1}.direction[data-direction=left]{grid-column:1;grid-row:2}.direction[data-direction=right]{grid-column:3;grid-row:2}.direction[data-direction=down]{grid-column:2;grid-row:3}.direction.is-pressed{background:#c8b8f5;transform:scale(.94)}.grab{flex-shrink:0;width:112px;height:112px;border-radius:50%;background:var(--pink);color:white;outline:5px solid #fff0f6;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;font-size:20px;font-weight:650;touch-action:manipulation}.grab .icon{width:48px;height:48px;stroke-width:1.8}.grab:disabled{opacity:.5}.exit-row{display:flex;justify-content:center;margin-top:14px}.sync-status{font-size:12px;text-align:center;padding:8px 16px;color:#946132;background:#fff7e8;position:sticky;bottom:0;z-index:3}.preview-game-state{font-size:12px;color:var(--muted);min-height:18px;margin:9px 0 0;text-align:center}
dialog{position:fixed;inset:auto 0 0;margin:0 auto;border:0;width:min(100%,480px);max-width:480px;max-height:85dvh;padding:12px 20px calc(18px + env(safe-area-inset-bottom));border-radius:28px 28px 0 0;color:var(--ink);background:white;overflow:auto;overscroll-behavior:contain}dialog::backdrop{background:#20203675}dialog[open]{animation:sheet-in .18s ease-out}.sheet-handle{width:40px;height:5px;border-radius:10px;background:#d3d1e1;margin:2px auto 10px}.sheet-heading{position:relative;min-height:42px;display:flex;align-items:center;justify-content:center;margin-bottom:20px}.sheet-heading h2{font-size:21px;text-align:center;max-width:calc(100% - 80px)}.sheet-heading .icon-button{position:absolute;right:-7px;top:-6px}.recharge-balance{background:#fbfaff;border-radius:18px;height:64px;display:flex;align-items:center;gap:12px;padding:12px 16px;font-weight:650;font-size:15px}.recharge-balance strong{font-size:27px;margin-left:auto}.sheet-note{font-size:14px;color:var(--muted);line-height:1.6;margin:14px 0 20px}.selected-device{background:#f4f1ff;border-radius:19px;display:flex;align-items:center;gap:16px;padding:12px 18px;margin-bottom:20px}.selected-device img{width:48px;height:65px;object-fit:contain}.selected-device strong{font-size:16px;display:block;margin-bottom:4px}.sheet-secondary{display:block;width:100%;margin-top:8px}.option{display:flex;justify-content:space-between;align-items:center;text-align:left;width:100%;padding:14px 16px;min-height:50px;border-radius:15px;margin:5px 0;font-size:16px}.option.selected{background:var(--pale-pink);color:#ea3d86}.option small{color:var(--muted);font-size:13px}.toast{position:fixed;z-index:30;left:50%;top:45%;transform:translate(-50%,-50%);width:max-content;max-width:min(84vw,360px);background:#292b40eb;color:white;border-radius:15px;padding:14px 20px;font-size:14px;line-height:1.6;text-align:center;pointer-events:none}.all-prizes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px 12px}.prizes-header{display:flex;justify-content:space-between;align-items:center}.prizes-header button{color:var(--muted);font-size:12px;margin-bottom:10px}.menu-note{font-size:14px;line-height:1.8;color:var(--muted);margin:0 8px 15px}.document-link{color:#aa4786}
.machine-card .machine-image{height:165px}
.before-play .video-frame{aspect-ratio:1.18}
.before-play .prize-list .prize-item img{height:76px;aspect-ratio:auto}
.before-play .prize-list .image-empty{height:76px;aspect-ratio:auto}
@keyframes shine{to{background-position:-150% 0}}@keyframes sheet-in{from{transform:translateY(25px);opacity:.7}to{transform:translateY(0);opacity:1}}
@media(min-width:600px){.app-shell{box-shadow:0 0 60px #d5d6e838;min-height:100vh}body{background:#eceef7}.page-header{padding-top:10px;height:72px}}
@media(max-width:370px){.content{padding-left:12px;padding-right:12px}.machine-card{padding:8px 10px 12px}.machine-card .machine-image{height:163px}.dpad{grid-template-columns:repeat(3,46px);grid-template-rows:repeat(3,46px)}.grab{width:100px;height:100px}.control-deck{padding:18px 12px;gap:10px}.coin-bar{gap:8px;padding:10px}.pill{padding:0 14px}.coin-label{font-size:14px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
/* Use the viewport's actual insets, not an iPhone model/UA-specific spacer.
   This also overrides the wide-screen header rule when a phone rotates. */
:root{
  --safe-top:env(safe-area-inset-top,0px);
  --safe-bottom:env(safe-area-inset-bottom,0px);
  --safe-side:max(env(safe-area-inset-left,0px),env(safe-area-inset-right,0px));
}
.page-header{
  height:calc(62px + var(--safe-top));
  padding-top:var(--safe-top);
  padding-left:calc(12px + var(--safe-side));
  padding-right:calc(12px + var(--safe-side));
  background:#f8f9fe;
}
/* Keep a tall sheet's close button below the island too. */
dialog{max-height:min(85dvh,calc(100dvh - var(--safe-top) - 12px))}
@media(orientation:landscape) and (pointer:coarse){
  .content{padding-left:calc(16px + var(--safe-side));padding-right:calc(16px + var(--safe-side))}
}
