* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body {
  margin: 0;
  height: 100%;
  background: #2B1A10;
  color: #4A2B16;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body { overflow: hidden; user-select: none; -webkit-user-select: none; }
input { user-select: text; -webkit-user-select: text; }
button, input { font-family: inherit; }
button { touch-action: manipulation; }
#app {
  position: relative;
  width: min(520px, 100%);
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: #FFF6E6;
}

/* ============ 开始页 ============ */
.start {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  background: linear-gradient(180deg, #A9E2FA 0%, #BFE9FF 4%, #FFF7E8 46%, #FFF1DC 100%);
}
.home-hero {
  position: relative;
  flex: 0 0 auto;
  height: clamp(300px, 54vh, 500px);
  overflow: hidden;
  background: #9FDCF7;
  border-radius: 0 0 30px 30px;
  box-shadow: 0 14px 30px rgba(76, 43, 16, .14);
}
.home-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  animation: heroFloat 9s ease-in-out infinite;
  transform-origin: 50% 46%;
}
@keyframes heroFloat {
  0%, 100% { transform: scale(1.02); }
  50% { transform: scale(1.055); }
}
.hero-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(70, 40, 15, .08) 0%, transparent 18%, transparent 76%, rgba(70, 40, 15, .18) 100%),
    radial-gradient(ellipse at 50% 0%, transparent 52%, rgba(50, 100, 40, .12) 100%);
}
.hero-ribbon {
  position: absolute;
  left: 14px;
  bottom: 36px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 11px 0 8px;
  border-radius: 999px;
  background: rgba(255, 252, 242, .88);
  border: 1.5px solid rgba(255, 255, 255, .85);
  box-shadow: 0 3px 0 rgba(92, 60, 18, .16), 0 6px 14px rgba(60, 40, 10, .12);
  color: #6B4628;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .2px;
  backdrop-filter: blur(4px);
}
.hero-ribbon .mp-icon { width: 14px; height: 14px; color: #F08A35; }

.home-panel {
  position: relative;
  z-index: 3;
  flex: 1;
  min-height: 0;
  margin-top: -24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 13px;
  padding: 22px 18px calc(16px + env(safe-area-inset-bottom));
  border-radius: 30px 30px 0 0;
  background-color: #FFF9ED;
  background-image:
    radial-gradient(rgba(255, 138, 61, .07) 1.5px, transparent 1.6px),
    linear-gradient(180deg, #FFFDF8 0%, #FFF7E8 52%, #FFEED7 100%);
  background-size: 18px 18px, 100% 100%;
  box-shadow: 0 -12px 30px rgba(74, 43, 22, .14);
  animation: panelIn .42s cubic-bezier(.2, .8, .2, 1);
}
@keyframes panelIn { from { opacity: 0; transform: translateY(12px); } }

.home-meta { display: flex; gap: 9px; align-items: stretch; width: 100%; }
.player-chip {
  flex: 1 1 auto;
  min-width: 0;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 11px 6px 6px;
  border: 2px solid #F0C9A0;
  border-radius: 18px;
  background: linear-gradient(180deg, #FFFFFF, #FFF8EC);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 4px 0 #EFD4B5, 0 8px 14px rgba(120, 70, 20, .07);
  transition: transform .12s ease, box-shadow .12s ease;
}
.player-chip:active { transform: translateY(2px); box-shadow: 0 2px 0 #EFD4B5; }
.player-chip .avatar {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  overflow: hidden;
  background: #FFE6C1;
  box-shadow: inset 0 0 0 2px #fff, 0 2px 0 rgba(170, 110, 50, .14);
}
.player-chip .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.player-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.player-text b {
  overflow: hidden;
  color: #4A2B16;
  font-size: 15px;
  line-height: 1.15;
  font-weight: 900;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.player-text em { font-style: normal; color: #B08A64; font-size: 10px; font-weight: 700; }
.edit-ico { flex: none; width: 16px; height: 16px; color: #C7A17A; }

.best-chip {
  flex: 0 0 94px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 2px solid #FFD98B;
  border-radius: 18px;
  background: linear-gradient(180deg, #FFF7DF, #FFE8B2);
  box-shadow: 0 4px 0 #EFC36B;
}
.best-chip .mp-icon { flex: none; width: 25px; height: 25px; color: #F0A11A; }
.best-text { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.best-text b { color: #C46A12; font-size: 19px; line-height: 1.1; font-weight: 900; letter-spacing: -.4px; }
.best-text em { font-style: normal; color: #B08245; font-size: 10px; font-weight: 800; }

.start-btn {
  position: relative;
  width: 100%;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 22px;
  background: linear-gradient(180deg, #FFB466 0%, #FF8A3D 46%, #F26F1C 100%);
  color: #fff;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-shadow: 0 2px 0 rgba(150, 60, 10, .3);
  cursor: pointer;
  box-shadow:
    0 7px 0 #C9571A,
    0 14px 22px rgba(210, 90, 20, .3),
    inset 0 2px 0 rgba(255, 255, 255, .55);
  transition: transform .12s ease, box-shadow .12s ease;
}
.start-btn::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, .38);
  pointer-events: none;
}
.start-btn::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  top: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .38);
  filter: blur(1px);
  pointer-events: none;
}
.start-btn:active { transform: translateY(4px); box-shadow: 0 3px 0 #C9571A, 0 8px 14px rgba(210, 90, 20, .26); }
.start-btn .btn-ico {
  width: 40px;
  height: 40px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .32);
  animation: iconPulse 2.4s ease-in-out infinite;
}
.start-btn .btn-ico .mp-icon { width: 27px; height: 27px; }
@keyframes iconPulse { 50% { transform: scale(1.08); } }

.home-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; width: 100%; }
.fact {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px 4px;
  border: 1.5px solid #F2D8B9;
  border-radius: 12px;
  background: rgba(255, 255, 255, .68);
  color: #7A5738;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.fact .mp-icon { flex: none; width: 15px; height: 15px; color: #F08A35; }
.fact b { font-weight: 800; }
.home-tip b { color: #C46A12; font-weight: 900; }
.home-tip {
  width: 100%;
  margin: 0;
  text-align: center;
  color: #A37D58;
  font-size: 11.5px;
  line-height: 1.5;
  font-weight: 700;
}
.best-line { display: none; }

/* ============ 对局页 ============ */
.game {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 84% 8%, rgba(255, 224, 150, .96) 0 52px, rgba(255, 224, 150, .28) 54px 82px, transparent 84px),
    radial-gradient(circle at 12% 15%, rgba(255, 255, 255, .9) 0 30px, transparent 32px),
    radial-gradient(circle at 27% 20%, rgba(255, 255, 255, .66) 0 22px, transparent 24px),
    linear-gradient(180deg, #8ED7F7 0%, #C9EEFF 34%, #FFF7E6 68%, #FFEFD2 100%);
}
.game::before {
  content: "";
  position: absolute;
  left: -14%;
  right: -14%;
  bottom: 21%;
  height: 34%;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 24% 100%, rgba(139, 193, 98, .30) 0 48%, transparent 49%),
    radial-gradient(ellipse at 76% 100%, rgba(139, 193, 98, .24) 0 52%, transparent 53%);
}
.sun {
  position: absolute;
  top: calc(68px + env(safe-area-inset-top));
  right: 20px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #FFE08A;
  box-shadow: 0 0 0 12px rgba(255, 224, 138, .32);
  pointer-events: none;
}
.cloud { position: absolute; height: 18px; border-radius: 20px; background: #fff; opacity: .95; pointer-events: none; }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.c1 { width: 74px; top: calc(74px + env(safe-area-inset-top)); left: 16px; }
.c1::before { width: 26px; height: 26px; left: 14px; top: -14px; }
.c1::after { width: 34px; height: 34px; left: 34px; top: -18px; }
.c2 { width: 52px; top: calc(126px + env(safe-area-inset-top)); right: 76px; }
.c2::before { width: 20px; height: 20px; left: 8px; top: -10px; }
.c2::after { width: 26px; height: 26px; left: 22px; top: -14px; }

.hud {
  position: relative;
  z-index: 3;
  display: flex;
  gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 8px;
}
.pill {
  min-width: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border: 1.5px solid #F0D1A9;
  border-radius: 14px;
  background: rgba(255, 253, 246, .94);
  color: #4A2B16;
  font-size: 15px;
  box-shadow: 0 4px 0 rgba(214, 160, 105, .32), 0 10px 18px rgba(110, 60, 20, .09);
  backdrop-filter: blur(8px);
}
.pill .mp-icon { flex: none; width: 18px; height: 18px; color: #F08A35; }
.pill b { font-size: 15px; font-weight: 900; white-space: nowrap; }
.pill.timer { flex: 1.05; position: relative; overflow: hidden; }
.time-fill {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, #FFC46A, #FF8A3D);
  transition: width .35s linear;
}
.pill.level { flex: 1.2; justify-content: center; }
.pill.score { flex: .92; justify-content: flex-end; }
.pill.timer.warn {
  color: #D9482B;
  border-color: #F4B39E;
  background: #FFF0EA;
  animation: pulse 1s ease infinite;
}
.pill.timer.warn .mp-icon { color: #E0512F; }
.pill.timer.warn .time-fill { background: linear-gradient(90deg, #FF9B7A, #E0512F); }
.pill.score.pop b { animation: scorepop .35s ease; }
@keyframes pulse { 50% { transform: scale(1.04); } }
@keyframes scorepop { 40% { transform: scale(1.28); } }

.stage { position: relative; z-index: 1; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.playfield { position: relative; flex: 1; min-height: 0; }
.dock {
  position: relative;
  z-index: 2;
  flex: none;
  padding: 8px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(255, 248, 236, 0) 0%, rgba(255, 248, 236, .58) 16%, rgba(255, 244, 225, .94) 100%);
}
.prop-row { display: flex; gap: 8px; margin-bottom: 8px; }
.prop {
  flex: 1;
  min-width: 0;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 4px;
  border: 1.5px solid #F2D2AA;
  border-radius: 14px;
  background: linear-gradient(180deg, #FFFDF8, #FFF1DE);
  color: #6B4426;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 #EBCBA4, 0 8px 12px rgba(110, 60, 20, .07);
  transition: transform .12s ease, box-shadow .12s ease;
}
.prop span { white-space: nowrap; }
.prop .mp-icon { flex: none; width: 18px; height: 18px; color: #F08A35; }
.prop em {
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 11px;
  background: linear-gradient(180deg, #FFB05E, #FF8A3D);
  color: #fff;
  font-style: normal;
  font-size: 12px;
  line-height: 21px;
  text-align: center;
  box-shadow: 0 2px 0 #D96D21;
}
.prop:active { transform: translateY(2px); box-shadow: 0 2px 0 #EBCBA4; }
.prop.spent { color: #B39A86; border-color: #EADCCB; box-shadow: 0 3px 0 #E7D8C7; background: #FBF3E7; }
.prop.spent .mp-icon { color: #C7AC92; }
.prop.spent em { background: #D9C6AF; box-shadow: 0 2px 0 #C6B09A; }

.tray {
  display: flex;
  gap: 4px;
  padding: 7px;
  border: 2px solid #E09A51;
  border-radius: 20px;
  background: linear-gradient(180deg, #FFD9A4, #FFBE74);
  box-shadow:
    0 6px 0 #B9662B,
    0 14px 22px rgba(120, 60, 10, .2),
    inset 0 2px 0 rgba(255, 255, 255, .6);
  transition: background .2s ease;
}
.tray.wide { gap: 3px; padding: 6px; }
.tray.wide .well { height: 50px; }
.tray.danger {
  background: linear-gradient(180deg, #FFCB9A, #FFA45F);
  box-shadow: 0 6px 0 #C56226, 0 14px 22px rgba(160, 50, 10, .24), inset 0 2px 0 rgba(255, 255, 255, .55);
}
.tray.full { animation: trayshake .4s linear; }
.well {
  flex: 1;
  height: 56px;
  border-radius: 10px;
  background: rgba(255, 250, 240, .58);
  box-shadow: inset 0 2px 4px rgba(120, 60, 20, .17);
}
.well.next { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .9), inset 0 2px 4px rgba(120, 60, 20, .12); }
@keyframes trayshake {
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

.tile {
  position: absolute;
  padding: 0;
  border: 2px solid #F2D2AC;
  border-radius: 12px;
  background: linear-gradient(180deg, #FFFEFB, #FFEFD6);
  box-shadow: 0 3px 0 #E2B888, 0 7px 10px rgba(120, 70, 20, .14);
  z-index: 1;
  touch-action: none;
  will-change: left, top;
}
.stage.anim .tile {
  transition: left .22s cubic-bezier(.2, .75, .2, 1), top .22s cubic-bezier(.2, .75, .2, 1), width .22s, height .22s;
}
.tile .face {
  position: absolute;
  inset: 8% 8% 11%;
  border-radius: 8px;
  background: #FFFDF9;
  box-shadow: inset 0 0 0 2px rgba(255, 170, 90, .28);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tile .stripe {
  position: absolute;
  top: 6px;
  width: 42%;
  height: 4px;
  border-radius: 4px;
  opacity: .85;
}
.tile .mp-icon { width: 54%; height: 54%; }
.tile.is-hot { cursor: pointer; }
.tile.is-hot:active { transform: translateY(2px) scale(.96); }
.tile.is-blocked {
  border-color: #E4D2BB;
  box-shadow: 0 2px 0 #CBB79F, 0 4px 8px rgba(80, 50, 10, .08);
  filter: saturate(.55) brightness(.9);
}
.tile.is-blocked .face { box-shadow: inset 0 0 0 2px rgba(160, 140, 110, .24); }
.tile.is-blocked::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(90, 60, 30, .2);
}
.tile.nope { animation: nope .28s linear; }
.tile.clearing { animation: burst .26s ease forwards; pointer-events: none; }
.tile.spin .mp-icon { animation: twist .42s ease; }
@keyframes nope {
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}
@keyframes burst {
  40% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(.2); opacity: 0; }
}
@keyframes twist {
  50% { transform: rotate(180deg) scale(.75); }
  100% { transform: rotate(360deg) scale(1); }
}

.banner {
  position: absolute;
  left: 50%;
  top: 38%;
  z-index: 2600;
  font-size: 40px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 3px 0 #F08A35, 0 7px 0 #C9571A, 0 12px 18px rgba(120, 50, 0, .2);
  pointer-events: none;
  white-space: nowrap;
}
.banner.show { animation: banner .9s ease forwards; }
@keyframes banner {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(.8); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  72% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -70%) scale(1.04); }
}
.floater {
  position: absolute;
  z-index: 2400;
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 0 #F08A35, 0 4px 0 #C9571A;
  pointer-events: none;
  animation: floatup .7s ease forwards;
}
@keyframes floatup {
  0% { opacity: 0; transform: translate(-50%, 6px) scale(.8); }
  25% { opacity: 1; transform: translate(-50%, -4px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -30px) scale(1); }
}
.toast {
  position: absolute;
  left: 50%;
  bottom: calc(132px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 80;
  max-width: calc(100% - 48px);
  padding: 10px 15px;
  border: 1.5px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: rgba(74, 43, 22, .92);
  color: #FFF4E4;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 8px 20px rgba(40, 20, 5, .24);
}

.mask {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(52, 29, 12, .55);
  backdrop-filter: blur(3px);
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.dialog {
  width: min(100%, 340px);
  max-height: calc(100% - 24px);
  overflow: auto;
  padding: 22px 18px calc(16px + env(safe-area-inset-bottom));
  border: 2px solid #F3D6B3;
  border-radius: 28px;
  background: linear-gradient(180deg, #FFFDF8, #FFF3E2);
  text-align: center;
  box-shadow: 0 24px 60px rgba(50, 25, 5, .35), inset 0 2px 0 #fff;
  animation: dialogIn .24s cubic-bezier(.2, .8, .2, 1);
}
@keyframes dialogIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
.dialog h2 { margin: 8px 0 4px; color: #4A2B16; font-size: 26px; line-height: 1.2; font-weight: 900; }
.dialog-kicker { margin: 9px 0 0; color: #F08A35; font-size: 11px; font-weight: 900; letter-spacing: 1px; }
.dialog .lead { margin: 0; color: #8A6542; font-size: 14px; font-weight: 700; }
.dialog .meta { margin: 5px 0 0; color: #8A6542; font-size: 12px; font-weight: 700; }
.dialog .bonus-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0 2px;
  padding: 7px 14px;
  border-radius: 999px;
  background: #FFF2C8;
  border: 1.5px solid #FFD98B;
  color: #C46A12;
  font-size: 14px;
  font-weight: 900;
}
.dialog .score-block { display: flex; flex-direction: column; align-items: center; margin: 10px 0 4px; }
.dialog .score-block span { color: #A37D58; font-size: 11px; font-weight: 800; }
.dialog .score-block b {
  color: #FF8A3D;
  font-size: 54px;
  line-height: 1.05;
  font-weight: 900;
  text-shadow: 0 3px 0 rgba(240, 106, 26, .15);
}
.dialog .stats-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 6px; }
.dialog .stats-row .meta { margin: 0; padding: 5px 10px; border-radius: 999px; background: #FFF1D9; color: #8A6542; }
.dialog .record { margin: 9px 0 13px; color: #C46A12; font-size: 14px; font-weight: 900; }
.dialog .who-line { margin: 8px 0 0; color: #8A6542; font-size: 13px; font-weight: 800; }
.dialog .revive-hint { margin: 2px 0 4px; color: #A37D58; font-size: 11px; }
.badge-ico {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 24px;
  background: #FFF2D8;
  color: #FF8A3D;
  box-shadow: inset 0 0 0 3px #FFD98B, 0 5px 0 #E9C38A;
}
.badge-ico img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge-ico .mp-icon { width: 36px; height: 36px; }

.play-btn {
  width: 100%;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  padding: 0 14px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(180deg, #FFAE5C, #FF8A3D);
  color: #fff;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: .5px;
  cursor: pointer;
  text-shadow: 0 2px 0 rgba(150, 60, 10, .28);
  box-shadow: 0 5px 0 #C9571A, 0 10px 18px rgba(210, 90, 20, .24), inset 0 2px 0 rgba(255, 255, 255, .45);
  transition: transform .12s ease, box-shadow .12s ease;
}
.play-btn .mp-icon { width: 21px; height: 21px; }
.play-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #C9571A, 0 6px 12px rgba(210, 90, 20, .2); }
.ghost-btn {
  width: 100%;
  height: 42px;
  margin-top: 4px;
  border: 0;
  background: transparent;
  color: #A37D58;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.ghost-btn:active { opacity: .55; }
.line-btn {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  border: 2px solid #FFD0A8;
  border-radius: 16px;
  background: #fff;
  color: #E96A1F;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
}
.line-btn .mp-icon { width: 20px; height: 20px; }
.line-btn:active { transform: translateY(2px); }

.ad-card { padding-top: 16px; }
.ad-screen {
  position: relative;
  height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
  border-radius: 20px;
  background:
    radial-gradient(circle at 72% 16%, rgba(255, 255, 255, .25), transparent 42%),
    linear-gradient(160deg, #384A63, #1D2939 72%);
  color: #fff;
  box-shadow: inset 0 0 0 2px rgba(255, 190, 120, .35);
}
.ad-screen::after {
  content: "";
  position: absolute;
  left: -30%;
  bottom: -55%;
  width: 160%;
  height: 90%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 138, 61, .24), transparent 70%);
  pointer-events: none;
}
.ad-tag {
  position: absolute;
  top: 11px;
  left: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #FFD79A;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .6px;
}
.ad-tag .mp-icon { width: 14px; height: 14px; }
.ad-screen b { position: relative; z-index: 1; color: #FFD166; font-size: 52px; line-height: 1; font-weight: 900; text-shadow: 0 3px 0 #B86A1D; }
#adSub { position: relative; z-index: 1; color: #FFD9B0; font-size: 12px; font-weight: 800; }
.ad-card h2 { margin-top: 10px; }
.ad-note { margin: 8px 0 0; color: #B08A64; font-size: 11px; font-weight: 700; }

.name-field { position: relative; margin: 14px 0 6px; }
.name-field .mp-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 20px;
  height: 20px;
  color: #C7A27A;
  transform: translateY(-50%);
}
.name-field input {
  width: 100%;
  height: 54px;
  padding: 0 42px;
  border: 2px solid #F0D1A9;
  border-radius: 16px;
  background: #fff;
  color: #4A2B16;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
}
.name-field input:focus { outline: none; border-color: #FF8A3D; box-shadow: 0 0 0 4px rgba(255, 138, 61, .14); }

.start-btn:focus-visible, .play-btn:focus-visible, .prop:focus-visible, .player-chip:focus-visible,
.ghost-btn:focus-visible, .line-btn:focus-visible {
  outline: 3px solid #FFD7B0;
  outline-offset: 2px;
}

@media (max-height: 700px) {
  .well { height: 50px; }
  .tray.wide .well { height: 46px; }
  .prop { height: 44px; }
  .hud { padding-top: calc(8px + env(safe-area-inset-top)); }
  .pill { min-height: 38px; }
}
@media (max-height: 540px) {
  .home-hero { height: 235px; }
  .home-panel { gap: 8px; padding-top: 12px; }
  .home-facts, .home-tip { display: none; }
  .well { height: 44px; }
  .prop-row { margin-bottom: 5px; }
}
@media (max-width: 360px) {
  .home-panel { padding-left: 14px; padding-right: 14px; }
  .fact { gap: 3px; font-size: 9.5px; }
  .fact .mp-icon { width: 14px; height: 14px; }
  .best-chip { flex-basis: 86px; padding: 0 8px; }
  .best-text b { font-size: 17px; }
  .player-text b { font-size: 14px; }
  .start-btn { font-size: 21px; }
}
@media (min-width: 520px) {
  #app { box-shadow: 0 0 0 1px rgba(255, 255, 255, .2), 0 22px 60px rgba(20, 10, 2, .45); }
}
@media (prefers-reduced-motion: reduce) {
  .home-art, .home-panel, .start-btn .btn-ico, .stage.anim .tile, .banner.show, .floater, .tile.clearing, .tile.nope,
  .pill.timer.warn, .mask, .dialog { animation: none; transition: none; }
}
