* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  color: #183D38;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Helvetica Neue", sans-serif;
  background: #FFE6CC;
}
button, input { font-family: inherit; }
button { cursor: pointer; -webkit-appearance: none; appearance: none; }
.bg { position: fixed; inset: 0; pointer-events: none; background:
  radial-gradient(120% 70% at 100% -10%, rgba(255, 176, 92, .55), transparent 55%),
  radial-gradient(90% 50% at -10% 20%, rgba(255, 214, 170, .8), transparent 50%),
  linear-gradient(180deg, #FFE3C4 0%, #FFF6EC 42%, #F6EFE6 100%); }
.blob { position: absolute; border-radius: 50%; filter: blur(2px); }
.b1 { width: 220px; height: 220px; right: -70px; top: -40px; background: rgba(255, 166, 77, .35); }
.b2 { width: 140px; height: 140px; left: -50px; top: 180px; background: rgba(255, 196, 140, .45); }
.b3 { width: 180px; height: 180px; right: -40px; bottom: 80px; background: rgba(255, 138, 61, .12); }

#app {
  position: relative;
  z-index: 1;
  height: 100%;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
}
.screen { display: none; flex: 1; min-height: 0; flex-direction: column;
  padding: calc(8px + max(env(safe-area-inset-top, 0px), var(--sat, 28px))) 16px 12px; overflow: auto; }
.screen.on { display: flex; }
#app.immersive .tabbar { display: none; }

.hero-head, .g-top { display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.brand h1, .page-head h2, .g-title b, .end-body h2 { margin: 0; font-weight: 800; letter-spacing: -0.02em; }
.brand h1 { font-size: 26px; color: #183D38; }
.brand p, .page-head p, .g-title span { margin: 2px 0 0; font-size: 12px; color: #486E66; }
.logo { width: 46px; height: 46px; border-radius: 16px; background: #fff; display: grid; grid-template-columns: 1fr 1fr;
  gap: 3px; padding: 8px; box-shadow: 0 6px 16px rgba(180, 90, 20, .12); border: 1px solid rgba(255,255,255,.8); }
.logo i { border-radius: 50%; }
.logo .bk, .st.bk, .floater.bk, .orb.bk { background: radial-gradient(circle at 35% 30%, #6b6b6b, #1a1a1a 70%); }
.logo .wt, .st.wt, .floater.wt, .orb.wt { background: radial-gradient(circle at 35% 30%, #fff, #dedede 72%); box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); }
.icon-btn, .more {
  width: 44px; height: 44px; border-radius: 14px; border: 1px solid rgba(255,255,255,.8);
  background: rgba(255,255,255,.86); color: #328A7F; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(120, 60, 10, .08); flex: none;
}
.icon-btn:active, .more:active { transform: scale(.96); }
.icon-btn .mp-icon, .more .mp-icon { width: 22px; height: 22px; }

.hero-card {
  position: relative; margin-top: 14px; height: 196px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,248,240,.9));
  border: 1px solid rgba(255,255,255,.85); box-shadow: 0 10px 28px rgba(180, 90, 30, .12);
  overflow: hidden;
}
.wood {
  position: absolute; left: 18px; right: 18px; top: 28px; bottom: 22px; border-radius: 12px;
  background: linear-gradient(160deg, #A4EEF3, #6AE5E7 46%, #4ED8D4);
  box-shadow: 0 12px 18px rgba(140, 70, 20, .22), inset 0 0 0 7px rgba(255, 220, 170, .35);
  transform: perspective(500px) rotateX(14deg);
}
.wood .grid {
  position: absolute; inset: 12px; border: 1.5px solid #288A7D;
  background-image:
    repeating-linear-gradient(to right, transparent 0, transparent calc(12.5% - 1px), #288A7D calc(12.5% - 1px), #288A7D 12.5%),
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(12.5% - 1px), #288A7D calc(12.5% - 1px), #288A7D 12.5%);
}
.st { position: absolute; width: 16px; height: 16px; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 2px 4px rgba(60,30,10,.35); }
.floater { position: absolute; width: 34px; height: 34px; border-radius: 50%; box-shadow: 0 8px 14px rgba(80,40,10,.25); }
.floater.bk { left: 8px; bottom: 28px; animation: floaty 3.2s ease-in-out infinite; }
.floater.wt { right: 10px; top: 26px; width: 28px; height: 28px; animation: floaty 3.6s ease-in-out infinite reverse; }
@keyframes floaty { 50% { transform: translateY(-7px); } }

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.mode-card {
  position: relative; text-align: left; border: 0; border-radius: 18px; min-height: 168px; padding: 14px 12px;
  overflow: hidden; color: #fff; box-shadow: 0 8px 18px rgba(190, 80, 20, .16);
  width: 100%; display: flex; flex-direction: column; align-items: flex-start;
}
.mode-card:active { transform: scale(.98); }
.mode-card.online { background: linear-gradient(165deg, #0CC28D 0%, #00E2B8 46%, #FF8A3D 100%); }
.mode-card.ai { background: linear-gradient(180deg, #FFF8F1, #FFE4C8); color: #1A4A42; border: 1px solid rgba(255,255,255,.9); }
.mode-card b { display: block; font-size: 17px; font-weight: 800; }
.mode-card > span { display: block; margin-top: 4px; font-size: 12px; line-height: 1.35; color: rgba(255,255,255,.92); max-width: 9em; }
.mode-card.ai > span { color: #528A7C; }
.mode-card .go {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 2px; margin-top: auto;
  background: #fff; color: #00C791; font-style: normal; font-weight: 800; font-size: 13px;
  border-radius: 999px; padding: 8px 12px; min-height: 36px;
}
.mode-card .go .mp-icon { width: 16px; height: 16px; }
.mode-card .go.dark { background: linear-gradient(180deg, #2AF0CD, #00C791); color: #fff; }
.globe { position: absolute; right: -6px; bottom: 8px; width: 78px; height: 78px; }
.globe i { position: absolute; inset: 8px; border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #9fd4ff, #E02F33 45%, #9C1B1A);
  box-shadow: inset -8px -6px 0 rgba(10, 40, 90, .18), 0 6px 10px rgba(20, 60, 120, .25); }
.globe i:after { content: ""; position: absolute; inset: 8px 10px auto 10px; height: 10px; border-radius: 20px; background: rgba(255,255,255,.35); }
.robot { position: absolute; right: 6px; bottom: 6px; width: 70px; height: 78px; }
.robot .ant { position: absolute; left: 32px; top: 0; width: 2px; height: 12px; background: #9ecbff; }
.robot .ant:before { content: ""; position: absolute; left: -3px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: #7eb6ff; }
.robot .face { position: absolute; left: 8px; top: 12px; width: 52px; height: 40px; border-radius: 16px; background: #fff;
  box-shadow: 0 6px 10px rgba(180, 100, 40, .18); }
.robot .face b { position: absolute; top: 14px; width: 7px; height: 7px; border-radius: 50%; background: #3ec6ff; }
.robot .face b:first-child { left: 12px; }
.robot .face b:nth-child(2) { right: 12px; }
.robot .face s { position: absolute; left: 18px; bottom: 8px; width: 16px; height: 8px; border-radius: 0 0 10px 10px; background: #ffb1c4; text-decoration: none; }

.banner {
  margin-top: 12px; width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 12px; border-radius: 16px; border: 1px solid rgba(255,255,255,.7);
  background: linear-gradient(90deg, #FFE7C4, #FFD19A); box-shadow: 0 8px 18px rgba(210, 120, 40, .12); color: #127A69;
}
.banner:active { transform: scale(.99); }
.cup { width: 48px; height: 48px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #FFE08A, #02DBF0); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); flex: none; }
.cup .mp-icon { width: 26px; height: 26px; }
.btxt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.btxt b { font-size: 16px; }
.btxt small { font-size: 12px; color: #32A59A; margin-top: 2px; }
.banner .more { width: 36px; height: 36px; border-radius: 50%; }

.page-head h2 { font-size: 22px; }
.my-rank, .me-card, .list, .code-card, .end-vs {
  background: #fff; border-radius: 16px; border: 1px solid rgba(80, 40, 10, .06);
  box-shadow: 0 8px 18px rgba(120, 60, 20, .06);
}
.my-rank {
  position: sticky; bottom: 8px; z-index: 6; margin-top: 12px; padding: 12px 14px;
  display: flex; align-items: center; gap: 12px; border-color: rgba(255, 138, 61, .3);
  box-shadow: 0 -6px 22px rgba(120, 60, 20, .12), 0 8px 18px rgba(120, 60, 20, .08);
}
.my-rank .meta { flex: 1; min-width: 0; }
.my-rank .meta .mini { display: block; font-size: 10px; font-weight: 700; color: #6BA59A; letter-spacing: .08em; }
.my-rank .meta b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.my-rank .rk { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.my-rank .rk b { font-size: 20px; font-weight: 800; color: #00C791; line-height: 1.1; }
.my-rank .rk span { margin-top: 2px; font-size: 10px; font-weight: 700; color: #6BA59A; }
.my-rank p { margin: 2px 0 0; color: #486E66; font-size: 12px; }
.rank-head {
  margin-top: 14px; padding: 0 14px 6px; display: grid; gap: 8px;
  grid-template-columns: 72px minmax(0, 1fr) 56px 52px;
  font-size: 11px; font-weight: 700; color: #6BA59A;
}
.rank-head span:nth-child(3), .rank-head span:nth-child(4) { text-align: right; }
.list { margin-top: 10px; padding: 4px 0; }
.rank-list { margin-top: 0; }
.rank-row, .hist-row {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: transparent; border: 0; text-align: left; color: inherit;
}
.rank-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) 56px 52px; gap: 8px; }
.rank-who { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rank-row .ava.sm { width: 30px; height: 30px; font-size: 12px; }
.rank-wins { text-align: right; font-size: 14px; font-weight: 800; color: #183D38; }
.rank-rate { text-align: right; font-size: 13px; font-weight: 800; color: #00C791; }
.rank-row + .rank-row, .hist-row + .hist-row { box-shadow: inset 0 1px 0 rgba(80,40,10,.06); }
.medal { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; background: #F3E6D8; color: #486E66; flex: none; }
.medal.m1 { background: linear-gradient(180deg, #FFE08A, #17D6E8); color: #fff; }
.medal.m2 { background: linear-gradient(180deg, #F5F7FA, #C5CDD6); color: #684E4E; }
.medal.m3 { background: linear-gradient(180deg, #F6C7A1, #5AC9B2); color: #fff; }
.rank-row .nm, .hist-row .nm { flex: 1; min-width: 0; }
.rank-row .nm b, .hist-row .nm b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-row .nm span, .hist-row .nm span { font-size: 12px; color: #486E66; }
.win-num { font-weight: 800; color: #00C791; font-size: 16px; }
.empty { padding: 28px 16px; text-align: center; color: #486E66; font-size: 14px; }
.empty b { display: block; color: #183D38; font-size: 16px; margin: 8px 0 4px; }

.me-card { margin-top: 12px; padding: 18px 16px 14px; display: flex; flex-direction: column; align-items: center; }
.ava { width: 44px; height: 44px; border-radius: 50%; flex: none; overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #FFB067, #00E2B8); color: #fff; font-weight: 800; font-size: 16px; }
.ava.lg { width: 72px; height: 72px; font-size: 28px; box-shadow: 0 8px 16px rgba(194, 78, 0, .25); }
.ava img { width: 100%; height: 100%; object-fit: cover; }
.ava.bot { background: linear-gradient(180deg, #E8F6FF, #B9E0FF); color: #A81D32; }
.ava .mp-icon { width: 22px; height: 22px; }
.name-edit { width: 100%; margin-top: 10px; }
.name-edit input {
  width: 100%; text-align: center; border: 0; background: #FBF6F1; border-radius: 12px; height: 44px;
  font-size: 16px; font-weight: 800; color: #183D38;
}
.stats { display: grid; grid-template-columns: 1fr 1fr 1fr; width: 100%; margin-top: 14px; }
.stats div { text-align: center; }
.stats b { display: block; font-size: 22px; color: #00C791; }
.stats span { font-size: 12px; color: #486E66; }
.block-title { margin: 16px 0 0; font-size: 15px; }

.tabbar {
  flex: none; display: flex; background: #fff; border-radius: 18px 18px 0 0;
  box-shadow: 0 -6px 20px rgba(80, 40, 10, .08);
  padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px));
}
.tab { flex: 1; border: 0; background: transparent; color: #B0A397; display: flex; flex-direction: column; align-items: center;
  gap: 2px; min-height: 54px; padding: 8px 0 6px; position: relative; }
.tab .mp-icon { width: 24px; height: 24px; }
.tab span { font-size: 11px; font-weight: 600; }
.tab .bar { width: 16px; height: 3px; border-radius: 2px; background: transparent; }
.tab.on { color: #00C791; }
.tab.on .bar { background: #FF8A3D; }
.tab:active { opacity: .7; }

.g-top { padding-bottom: 8px; }
.g-title { flex: 1; min-width: 0; }
.g-title b { display: block; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-pill { flex: none; background: #fff; color: #00C791; font-weight: 800; font-size: 12px; border-radius: 999px; padding: 6px 10px;
  box-shadow: 0 4px 10px rgba(120,60,20,.08); }
.diff-pill {
  flex: none; min-height: 34px; padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(255, 138, 61, .35);
  background: #fff; color: #00C791; font-size: 12px; font-weight: 800; box-shadow: 0 4px 10px rgba(120,60,20,.08);
}
.diff-pill:active, .help-btn:active { transform: scale(.94); }
.help-btn {
  flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255, 138, 61, .35);
  background: #FFF6EC; color: #00C791; font-size: 16px; font-weight: 800; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.g-top .help-btn { width: 34px; height: 34px; }
.help-btn.lg { width: 44px; height: 44px; border-radius: 12px; }
.ava-box { position: relative; flex: none; display: flex; align-items: center; }
.turn-timer {
  position: absolute; right: -11px; bottom: -5px; min-width: 34px; height: 22px; padding: 0 5px;
  border-radius: 11px; background: #183D38; color: #fff; font-style: normal; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 8px rgba(60, 30, 10, .25);
  letter-spacing: .02em; transition: background .2s;
}
.pvp.opp .turn-timer { right: auto; left: -11px; }
.turn-timer.urgent { background: #25D97B; animation: tickPulse .9s ease-in-out infinite; }
.turn-timer[hidden] { display: none !important; }
@keyframes tickPulse { 50% { transform: scale(1.12); } }
.vs { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 16px; padding: 10px;
  border: 1px solid rgba(80,40,10,.06); box-shadow: 0 6px 14px rgba(120,60,20,.05); }
.pvp { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.pvp.opp { justify-content: flex-end; }
.pmeta { min-width: 0; }
.pmeta.right { text-align: right; }
.pmeta b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 96px; }
.pmeta span { font-size: 12px; color: #486E66; }
.pvp.live { box-shadow: inset 0 0 0 0; }
.pvp.on .ava { box-shadow: 0 0 0 2px #FF8A3D; }
.vs-mid { font-size: 12px; font-weight: 800; color: #B4D7D3; }
.board-wrap { flex: 1; min-height: 220px; display: flex; align-items: center; justify-content: center; margin: 8px 0; }
#board, #endBoard { touch-action: none; border-radius: 18px; max-width: 100%; }
.status-line { text-align: center; font-size: 14px; font-weight: 700; color: #00C791; min-height: 22px; }
.status-line.wait { color: #486E66; }
.actions, .resign-ask { display: flex; gap: 8px; padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px)); }
.actions button, .resign-ask button, .ghost-btn, .primary, .join-form button, .text-btn {
  border-radius: 12px; min-height: 44px; font-size: 14px; font-weight: 800;
}
.actions button, .resign-ask button { flex: 1; border: 1px solid rgba(199, 62, 0, .25); background: #fff; color: #00C791; }
.actions button:active, .primary:active, .ghost-btn:active, .join-form button:active { transform: scale(.98); opacity: .92; }
.actions button.danger, .resign-ask button.danger { background: #FFF1F0; color: #2BC478; border-color: rgba(196, 56, 43, .2); }
.resign-ask { align-items: center; background: #fff; border-radius: 14px; padding: 8px; margin-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
.resign-ask span { flex: 1.4; font-size: 13px; color: #183D38; padding-left: 6px; }
.primary { width: 100%; border: 0; color: #fff; background: linear-gradient(180deg, #00E2B8, #0CC28D);
  box-shadow: 0 8px 16px rgba(199, 62, 0, .28); }
.ghost-btn { width: 100%; border: 1px solid rgba(80,40,10,.1); background: rgba(255,255,255,.8); color: #486D65; margin-top: 8px; }

.wait-body { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 12px; }
.wait-body h2 { margin: 8px 0 0; font-size: 22px; }
.wait-tip { margin: 6px 0 0; color: #486E66; font-size: 13px; }
.pulse { position: relative; width: 120px; height: 120px; margin-top: 12px; }
.pulse:before, .pulse:after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255,138,61,.35); animation: ping 2.2s ease-out infinite; }
.pulse:after { animation-delay: 1s; }
@keyframes ping { 70%, 100% { transform: scale(1.25); opacity: 0; } }
.orb { position: absolute; width: 36px; height: 36px; border-radius: 50%; top: 42px; box-shadow: 0 6px 10px rgba(60,30,10,.2); }
.orb.bk { left: 22px; }
.orb.wt { right: 22px; }
.code-card { width: 100%; margin-top: 16px; padding: 14px; }
.code-row { display: flex; justify-content: center; gap: 8px; }
.code-row i { width: 46px; height: 54px; border-radius: 12px; background: #FFF6EC; color: #00C791; font-style: normal;
  font-size: 24px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.text-btn { margin-top: 8px; border: 0; background: transparent; color: #00C791; }
.join-form { width: 100%; display: flex; gap: 8px; margin-top: 14px; }
.join-form input { flex: 1; height: 48px; border-radius: 12px; border: 1px solid rgba(80,40,10,.1); background: #fff;
  font-size: 16px; text-align: center; letter-spacing: .2em; color: #183D38; }
.join-form button { width: 76px; border: 0; color: #fff; background: linear-gradient(180deg, #00E2B8, #0CC28D); }

.end-body { position: relative; display: flex; flex-direction: column; align-items: center; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
.end-body h2 { font-size: 28px; margin-top: 8px; }
.end-body > p { margin: 4px 0 0; color: #486E66; font-size: 14px; }
.badge { width: 72px; height: 72px; border-radius: 24px; display: flex; align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(180deg, #FFD56A, #02DBF0); box-shadow: 0 10px 20px rgba(220, 150, 20, .28); margin-top: 8px; }
.badge .mp-icon { width: 36px; height: 36px; }
.badge.lose { background: linear-gradient(180deg, #E7D5C8, #94C4BC); box-shadow: none; }
.badge.draw { background: linear-gradient(180deg, #FFE0C2, #45E0CB); }
.dots { position: absolute; inset: 0; pointer-events: none; }
.screen.win .dots { background:
  radial-gradient(circle at 12% 18%, #FF8A3D 0 5px, transparent 6px),
  radial-gradient(circle at 86% 12%, #FFD56A 0 4px, transparent 5px),
  radial-gradient(circle at 80% 30%, #FFB067 0 3px, transparent 4px),
  radial-gradient(circle at 18% 36%, #02DBF0 0 3px, transparent 4px); }
.end-board { margin-top: 12px; width: min(100%, 280px); display: flex; justify-content: center; }
.end-vs { width: 100%; margin-top: 12px; padding: 12px; display: flex; align-items: center; justify-content: space-between; }
.end-vs > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.end-vs b { font-size: 14px; max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.end-vs em { font-style: normal; font-weight: 800; color: #00C791; }
.end-record { font-size: 12px !important; }
.ad-btn {
  width: 100%; margin-top: 12px; min-height: 56px; border: 0; border-radius: 14px;
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; text-align: left;
  color: #fff; background: linear-gradient(135deg, #FF8A3D, #FFAE5C);
  box-shadow: 0 8px 18px rgba(255, 138, 61, .28);
}
.ad-btn .mp-icon { width: 28px; height: 28px; flex: none; }
.ad-btn .ad-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ad-btn b { font-size: 15px; font-weight: 800; }
.ad-btn small { margin-top: 2px; font-size: 11px; color: rgba(255,255,255,.9); }
.ad-btn:active { transform: scale(.98); opacity: .94; }
.ad-btn[disabled] { opacity: .62; }
#btnAgain { margin-top: 14px; }

.mask { position: fixed; inset: 0; z-index: 20; background: rgba(40, 20, 8, .45); display: flex; align-items: flex-end; justify-content: center; }
.mask[hidden] { display: none; }
.sheet { width: 100%; max-width: 480px; background: #fff; border-radius: 20px 20px 0 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
.sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: #E6D9CE; margin: 6px auto 10px; }
.sheet h3 { margin: 0 0 8px; font-size: 18px; }
.set-row { display: flex; align-items: center; justify-content: space-between; min-height: 48px; font-size: 15px; }
.set-label { margin: 8px 0; font-size: 13px; color: #486E66; }
.switch { width: 52px; height: 32px; border-radius: 999px; border: 0; background: #E7DDD4; position: relative; }
.switch:before { content: ""; position: absolute; width: 26px; height: 26px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: left .15s; box-shadow: 0 2px 4px rgba(0,0,0,.15); }
.switch.on { background: #FF8A3D; }
.switch.on:before { left: 23px; }
.seg { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.seg button { height: 44px; border-radius: 12px; border: 1px solid rgba(80,40,10,.08); background: #FBF6F1; color: #486D65; font-weight: 800; }
.seg button.on { background: linear-gradient(180deg, #FF8A3D, #00C791); color: #fff; border-color: transparent; }
.diff-row { display: flex; align-items: center; gap: 8px; }
.diff-row .seg { flex: 1; min-width: 0; }
.difficulty-tip { margin: 8px 0 0; font-size: 12px; color: #6BA59A; text-align: center; }
.sheet .primary { margin-top: 16px; }
.tip-mask {
  position: fixed; inset: 0; z-index: 25; background: rgba(40, 20, 8, .5);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.tip-mask[hidden] { display: none; }
.tip-card {
  width: 100%; max-width: 340px; background: #FFFDFB; border-radius: 20px; padding: 18px 18px 16px;
  box-shadow: 0 18px 40px rgba(60, 30, 10, .28); border: 1px solid rgba(255, 255, 255, .9);
}
.tip-head { display: flex; align-items: center; gap: 8px; color: #00C791; }
.tip-head .mp-icon { width: 22px; height: 22px; }
.tip-head b { font-size: 17px; }
.tip-list { list-style: none; margin: 12px 0 4px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tip-list li { background: #FFF6EC; border-radius: 12px; padding: 9px 11px; border: 1px solid rgba(255, 138, 61, .14); }
.tip-list li b { display: block; font-size: 13px; color: #00C791; }
.tip-list li span { display: block; margin-top: 2px; font-size: 12px; line-height: 1.55; color: #486E66; }
.tip-card .primary { margin-top: 12px; }
.toast {
  position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(8px);
  background: rgba(48, 28, 16, .92); color: #fff; font-size: 13px; padding: 10px 14px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 30; max-width: 80%; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-height: 700px) {
  .hero-card { height: 150px; }
  .mode-card { min-height: 148px; }
  .floater { display: none; }
}
