/* 《蝦米！全台開爆》Production Self-Contained Stylesheet (Zero External CDN, Strict CSP Compliant) */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  background: #F3EEE6;
  color: #3D2F28;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: max(12px, env(safe-area-inset-top)) 10px max(16px, env(safe-area-inset-bottom));
}

button, select, input {
  font-family: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

.hidden {
  display: none !important;
}

/* ---------- Animations ---------- */
@keyframes floatSoft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes popIn {
  0% { transform: scale(0.86); opacity: 0; }
  70% { transform: scale(1.03); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes matchFlash {
  0% { transform: scale(1); background: #FFD55A; }
  50% { transform: scale(1.16); background: #FFF3CF; box-shadow: 0 0 18px #FFD55A; }
  100% { transform: scale(0.2); opacity: 0; }
}
@keyframes shakeSoft {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
@keyframes shakeHard {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
@keyframes hintPulse {
  0%, 100% { box-shadow: 0 5px 0 rgba(232,100,60,0.28), 0 0 0 0 rgba(255,213,90,0.75); }
  50% { box-shadow: 0 5px 0 rgba(232,100,60,0.28), 0 0 0 6px rgba(255,213,90,0); }
}
@keyframes floatScore {
  0% { transform: translate(-50%, 0) scale(0.85); opacity: 1; }
  100% { transform: translate(-50%, -44px) scale(1.14); opacity: 0; }
}
@keyframes urgentPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes mapBeacon {
  0% { r: 6; opacity: 0.95; stroke-width: 2.5; }
  100% { r: 20; opacity: 0; stroke-width: 0.6; }
}
@keyframes xiamiChomp {
  0%, 100% { transform: scale(1) rotate(0deg); }
  35% { transform: scale(1.09, 0.94) rotate(4deg) translateX(3px); }
  70% { transform: scale(0.97, 1.04) rotate(-2deg); }
}
@keyframes kernelWiggle {
  0%, 100% { transform: rotate(-6deg) scale(1); }
  50% { transform: rotate(6deg) scale(1.08); }
}
@keyframes crumbPop {
  0% { transform: translate(0, 0) scale(0.7); opacity: 1; }
  100% { transform: translate(8px, -18px) scale(1.1); opacity: 0; }
}
@keyframes popArcL1 {
  0%   { transform: translate(0, 0) scale(0.35) rotate(0deg); opacity: 0; }
  16%  { opacity: 1; }
  48%  { transform: translate(-22px, -36px) scale(1.05) rotate(-140deg); opacity: 1; }
  100% { transform: translate(-38px, 14px) scale(0.72) rotate(-290deg); opacity: 0; }
}
@keyframes popArcL2 {
  0%   { transform: translate(0, 0) scale(0.3) rotate(0deg); opacity: 0; }
  15%  { opacity: 1; }
  46%  { transform: translate(-11px, -44px) scale(0.95) rotate(-100deg); opacity: 1; }
  100% { transform: translate(-24px, 8px) scale(0.65) rotate(-240deg); opacity: 0; }
}
@keyframes popArcC {
  0%   { transform: translate(0, 0) scale(0.35) rotate(0deg); opacity: 0; }
  18%  { opacity: 1; }
  50%  { transform: translate(2px, -48px) scale(1.12) rotate(120deg); opacity: 1; }
  100% { transform: translate(8px, -6px) scale(0.7) rotate(260deg); opacity: 0; }
}
@keyframes popArcR1 {
  0%   { transform: translate(0, 0) scale(0.35) rotate(0deg); opacity: 0; }
  16%  { opacity: 1; }
  48%  { transform: translate(20px, -38px) scale(1.0) rotate(150deg); opacity: 1; }
  100% { transform: translate(34px, 12px) scale(0.68) rotate(310deg); opacity: 0; }
}
@keyframes popArcR2 {
  0%   { transform: translate(0, 0) scale(0.3) rotate(0deg); opacity: 0; }
  16%  { opacity: 1; }
  45%  { transform: translate(12px, -32px) scale(0.88) rotate(95deg); opacity: 1; }
  100% { transform: translate(26px, 16px) scale(0.6) rotate(220deg); opacity: 0; }
}

.mascot-float { animation: floatSoft 3s ease-in-out infinite; }
.pop-in { animation: popIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.08) forwards; }
.match-flash { animation: matchFlash 0.24s ease-out forwards; }
.shake-soft { animation: shakeSoft 0.22s ease-in-out; }
.shake-hard { animation: shakeHard 0.34s ease-in-out; }
.urgent-pulse { animation: urgentPulse 0.65s ease-in-out infinite; }
.xiami-chomp { animation: xiamiChomp 0.36s ease-in-out; }

/* ---------- Shell & Screen ---------- */
.app-shell {
  width: 100%;
  max-width: 410px;
  border-radius: 36px;
  padding: 8px;
  background: #DFD3C7;
  box-shadow: 0 22px 48px -18px rgba(61, 47, 40, 0.22);
}

@media (max-width: 440px) {
  body { padding: 0; background: #F8F4ED; }
  .app-shell {
    max-width: 100%;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    min-height: 100dvh;
  }
  .game-screen {
    border-radius: 0 !important;
    min-height: 100dvh !important;
  }
}

.game-screen {
  position: relative;
  width: 100%;
  min-height: 736px;
  border-radius: 28px;
  background: #F8F4ED;
  color: #3D2F28;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ---------- In-Game Top Bar ---------- */
.top-bar {
  padding: 14px 14px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.county-pill-btn {
  flex: 1;
  min-width: 0;
  border-radius: 16px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFFDF9;
  border: 1px solid #EAE0D4;
  box-shadow: 0 2px 6px rgba(61, 47, 40, 0.04);
  cursor: pointer;
  text-align: left;
}

.county-pill-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: #FFF2EA;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.county-pill-body {
  flex: 1;
  min-width: 0;
}

.county-pill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  font-weight: 900;
}

.county-pill-score {
  color: #E8643C;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: #EFE4D6;
  overflow: hidden;
  margin-top: 4px;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #FFD55A, #EC734B);
  transition: width 0.45s ease;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid #EAE0D4;
  background: #FFFDF9;
  box-shadow: 0 2px 6px rgba(61, 47, 40, 0.04);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* ---------- Hero XiaMi + Popcorn Countdown ---------- */
.xiami-hud-wrap {
  padding: 0 14px 8px;
  flex-shrink: 0;
}

.xiami-hud-card {
  border-radius: 24px;
  padding: 8px 12px;
  border: 1px solid #EAE0D4;
  background: linear-gradient(135deg, #FFFDF9, #FFF8EE);
  box-shadow: 0 2px 8px rgba(61, 47, 40, 0.04);
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.xiami-stage-wrap {
  position: relative;
  width: 82px;
  height: 82px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.xiami-stage-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.xiami-hud-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.hud-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.hud-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.badge-layer {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  color: #FFFFFF;
  background: #E8643C;
  flex-shrink: 0;
}

.badge-pot {
  font-size: 14px;
  font-weight: 900;
  color: #D48B08;
  font-variant-numeric: tabular-nums;
}

.badge-timer {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: #F3EBE1;
  color: #5C473D;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.badge-timer.urgent {
  background: #E8643C;
  color: #FFFFFF;
}

.popcorn-track-box {
  border-radius: 14px;
  padding: 5px 7px;
  border: 1px solid #EDE2D3;
  background: #FAF5EC;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
}

.kernel-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2), opacity 0.25s ease;
}

.kernel-item svg {
  width: 19px;
  height: 19px;
  display: block;
}

.kernel-item.eaten {
  transform: translateX(-8px) scale(0.26);
  opacity: 0.2;
  filter: grayscale(1);
}

.kernel-item.urgent {
  animation: kernelWiggle 0.45s ease-in-out infinite;
}

.hud-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
}

.hud-quote {
  color: #6B574C;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-kernels-left {
  color: #C96543;
  flex-shrink: 0;
}

.crumb-badge {
  position: absolute;
  right: -4px;
  top: 6px;
  font-size: 12px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 999px;
  pointer-events: none;
  animation: crumbPop 0.65s ease-out forwards;
}

/* ---------- 2.5D Board ---------- */
.board-section {
  padding: 0 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.board-stage {
  position: relative;
  width: 348px;
  max-width: 100%;
  height: 296px;
  border-radius: 24px;
  border: 2px solid #E2D5C4;
  background: #EDE4D7;
  box-shadow: inset 0 2px 10px rgba(61, 47, 40, 0.08);
  overflow: hidden;
}

.board-count-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 50;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: rgba(255, 253, 249, 0.92);
  color: #6B574C;
  pointer-events: none;
}

.tiles-layer {
  position: absolute;
  inset: 0;
}

.game-tile {
  position: absolute;
  width: 52px;
  height: 56px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.13s ease, filter 0.18s ease, box-shadow 0.14s ease;
}

.game-tile.open {
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(42, 31, 26, 0.22), 0 8px 14px rgba(42, 31, 26, 0.11);
}

.game-tile.open:hover {
  transform: translateY(-3px) scale(1.05);
  z-index: 45 !important;
}

.game-tile.open:active {
  transform: translateY(2px) scale(0.95);
}

.game-tile.open.hint-glow {
  animation: hintPulse 1.15s ease-in-out infinite;
}

.game-tile.blocked {
  cursor: pointer;
  filter: brightness(0.75) saturate(0.42);
  box-shadow: 0 2px 0 rgba(42, 31, 26, 0.22);
}

.tile-emoji-lg { font-size: 28px; line-height: 1; }
.tile-emoji-sm { font-size: 22px; line-height: 1; }
.tile-img-lg { width: 40px; height: 40px; object-fit: contain; pointer-events: none; }
.tile-img-sm { width: 32px; height: 32px; object-fit: contain; pointer-events: none; }

.float-score {
  position: absolute;
  left: 50%;
  top: 46%;
  pointer-events: none;
  font-size: 14px;
  font-weight: 900;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.96);
  box-shadow: 0 4px 12px rgba(61, 47, 40, 0.14);
  z-index: 60;
  animation: floatScore 0.72s ease-out forwards;
}

/* ---------- Temp Tray ---------- */
.temp-tray-wrap {
  width: 100%;
  max-width: 348px;
  margin-top: 6px;
}

.temp-tray-box {
  border-radius: 16px;
  padding: 6px 12px;
  border: 1.5px dashed #EC734B;
  background: #FFF8E7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.temp-tray-slots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.temp-tile-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* ---------- Bottom Controls & Exclusive Ad ---------- */
.bottom-controls {
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.slot-tray {
  border-radius: 18px;
  padding: 8px;
  border: 2px solid #9C5145;
  background: #B56557;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.16);
  transition: border-color 0.2s ease;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.slot-cell {
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slot-cell.empty {
  border: 1.5px dashed rgba(255, 255, 255, 0.36);
  background: rgba(0, 0, 0, 0.14);
}

.slot-cell.filled {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-skill {
  padding: 10px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 900;
  border: none;
  border-bottom: 4px solid;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.2s ease, transform 0.1s ease;
}
.btn-skill:active { transform: translateY(1px); }
.btn-skill-pop { background: #FFD55A; color: #4A280A; border-bottom-color: #D49C18; }
.btn-skill-shuffle { background: #3CA4DF; color: #FFFFFF; border-bottom-color: #217EB5; }
.skill-count {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.ad-bar {
  border-radius: 16px;
  padding: 9px 12px;
  border: 1.5px solid #EAE0D4;
  background: #FFFDF9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: filter 0.15s ease;
}
.ad-bar:hover { filter: brightness(0.98); }

.ad-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-pill {
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  color: #FFFFFF;
  background: #E8643C;
  flex-shrink: 0;
}

.ad-text {
  font-size: 12px;
  font-weight: 700;
  color: #6B574C;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-cta {
  font-size: 12px;
  font-weight: 900;
  color: #E8643C;
  flex-shrink: 0;
}

/* ---------- Overlays ---------- */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.overlay-welcome {
  background: #F8F4ED;
  justify-content: space-between;
  padding: 16px;
  gap: 10px;
}

.welcome-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.preshow-tag {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: #FFFDF9;
  border: 1px solid #EAE0D4;
  color: #C96543;
}

.welcome-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pill-btn {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid #E7DCCE;
  background: #FFFDF9;
  color: #5C4B42;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(61, 47, 40, 0.05);
}

.pill-btn-login {
  background: #EDF7FD;
  border-color: #B5DCF4;
  color: #1E78B4;
}

.pill-btn-member {
  background: #FFF3EC;
  border-color: #F3CEB9;
  color: #C94D28;
}

.hero-xiami-card {
  border-radius: 24px;
  padding: 10px 14px;
  border: 1px solid #EAE0D4;
  background: linear-gradient(135deg, #FFFDF9, #FFF6EA);
  box-shadow: 0 2px 10px rgba(61, 47, 40, 0.04);
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: visible;
}

.welcome-xiami-fountain {
  position: relative;
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.welcome-xiami-fountain img {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pop-fountain-kernel {
  position: absolute;
  left: 50%;
  top: 42%;
  margin-left: -10px;
  margin-top: -10px;
  pointer-events: none;
  z-index: 12;
  opacity: 0;
}
.pop-fountain-kernel svg { width: 20px; height: 20px; display: block; }
.pop-k1 { animation: popArcL1 2.0s cubic-bezier(0.22, 0.7, 0.45, 1) infinite 0.0s; }
.pop-k2 { animation: popArcR1 2.1s cubic-bezier(0.22, 0.7, 0.45, 1) infinite 0.35s; }
.pop-k3 { animation: popArcC  1.9s cubic-bezier(0.22, 0.7, 0.45, 1) infinite 0.72s; }
.pop-k4 { animation: popArcL2 2.2s cubic-bezier(0.22, 0.7, 0.45, 1) infinite 1.08s; }
.pop-k5 { animation: popArcR2 1.95s cubic-bezier(0.22, 0.7, 0.45, 1) infinite 1.45s; }
.pop-k6 { animation: popArcL1 2.05s cubic-bezier(0.22, 0.7, 0.45, 1) infinite 1.78s; }

.hero-title {
  font-size: 21px;
  font-weight: 900;
  line-height: 1.2;
  color: #3D2F28;
}

.hero-sub {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  color: #7A665B;
  margin-top: 4px;
}

/* ---------- Map Card ---------- */
.map-card {
  border-radius: 24px;
  padding: 12px;
  border: 1px solid #EAE0D4;
  background: linear-gradient(180deg, #FFFDF9 0%, #F5EFE6 100%);
  box-shadow: 0 2px 10px rgba(61, 47, 40, 0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.map-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 8px;
  align-items: center;
}

.map-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.taiwan-svg {
  width: 100%;
  max-width: 196px;
  height: auto;
  user-select: none;
}

.map-county {
  cursor: pointer;
  transition: filter 0.18s ease, fill 0.25s ease;
}
.map-county:hover { filter: brightness(1.06); }

.map-beacon-ring {
  fill: none;
  stroke: #E85D35;
  pointer-events: none;
  animation: mapBeacon 1.7s ease-out infinite;
}

.map-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-label {
  font-size: 12px;
  font-weight: 900;
  color: #C96543;
}

.top3-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.top3-item {
  width: 100%;
  border-radius: 14px;
  padding: 6px 10px;
  border: 1px solid #ECE2D5;
  background: #FFFDF9;
  text-align: left;
  cursor: pointer;
}
.top3-item.active {
  background: #FFF2EA;
  border-color: #EC734B;
}

.top3-name { font-size: 12px; font-weight: 900; color: #3D2F28; }
.top3-score { font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 1px; }

.legend-box {
  border-radius: 14px;
  padding: 8px;
  border: 1px solid #EDE3D7;
  background: #FAF6F0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #5C4B42;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.hook-strip {
  border-radius: 16px;
  padding: 10px 12px;
  border: 1px solid #F3CEB9;
  background: linear-gradient(135deg, #FFF4EC, #FFF9E8);
  color: #5C3120;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hook-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 900;
}

.hook-rank {
  padding: 2px 8px;
  border-radius: 999px;
  background: #EC734B;
  color: #FFFFFF;
  flex-shrink: 0;
}

.squad-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.squad-label {
  font-size: 12px;
  font-weight: 800;
  color: #7A665B;
  flex-shrink: 0;
}

.select-field, .text-field {
  width: 100%;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 800;
  border: 1px solid #E5D9CA;
  background: #FFFDF9;
  color: #3D2F28;
  outline: none;
}

.welcome-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.incentive-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
}

.incentive-pill {
  padding: 3px 10px;
  border-radius: 999px;
  background: #FFF3CF;
  color: #9A6212;
  font-weight: 900;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 900;
  color: #FFFFFF;
  background: #E8643C;
  border: none;
  border-bottom: 4px solid #C94D28;
  box-shadow: 0 6px 16px rgba(232, 100, 60, 0.25);
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.btn-primary:hover { filter: brightness(1.03); }
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
  width: 100%;
  padding: 13px;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 900;
  color: #FFFFFF;
  background: #3CA4DF;
  border: none;
  border-bottom: 4px solid #217EB5;
  cursor: pointer;
}

.btn-ghost {
  width: 100%;
  padding: 11px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 900;
  background: #F5EFE6;
  border: 1px solid #E2D5C4;
  color: #3D2F28;
  cursor: pointer;
}

.btn-line-share {
  width: 100%;
  padding: 11px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 900;
  background: #06C755;
  border: none;
  border-bottom: 3px solid #059B42;
  color: #FFFFFF;
  cursor: pointer;
}

/* ---------- Modal Overlays ---------- */
.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 60;
  padding: 20px;
  background: rgba(61, 47, 40, 0.54);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop-login { z-index: 70; }

.modal-card {
  position: relative;
  width: 100%;
  border-radius: 26px;
  padding: 20px;
  background: #FFFDF9;
  border: 1.5px solid #EAE0D4;
  box-shadow: 0 24px 48px rgba(42, 31, 26, 0.25);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #E5D9CA;
  background: #F8F4ED;
  color: #6B574C;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.modal-mascot {
  width: 90px;
  height: 90px;
  object-fit: contain;
  margin: 0 auto;
}

.modal-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  color: #FFFFFF;
  background: #22A06B;
}

.modal-big-score {
  font-size: 38px;
  font-weight: 900;
  color: #E8643C;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.modal-title {
  font-size: 21px;
  font-weight: 900;
  color: #3D2F28;
  margin-top: 6px;
}

.modal-sub {
  font-size: 13px;
  font-weight: 700;
  color: #6B574C;
  margin-top: 4px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.benefits-box {
  border-radius: 16px;
  padding: 12px;
  background: #F8F4ED;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: #5C4B42;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.oauth-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-oauth-line {
  width: 100%;
  padding: 12px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 900;
  color: #FFFFFF;
  background: #06C755;
  border: none;
  border-bottom: 4px solid #059B42;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-oauth-apple {
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 900;
  color: #FFFFFF;
  background: #2C2725;
  border: none;
  border-bottom: 4px solid #171413;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-oauth-google {
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 900;
  color: #3D2F28;
  background: #FFFFFF;
  border: 2px solid #E5D9CA;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-oauth-icon { width: 16px; height: 16px; flex-shrink: 0; }

.line-browser-tip {
  border-radius: 12px;
  padding: 8px 10px;
  background: #FFF3CF;
  color: #9A6212;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

/* ---------- Full Leaderboard Overlay ---------- */
.overlay-rank {
  z-index: 65;
  background: #F8F4ED;
  padding: 16px;
  justify-content: space-between;
  gap: 12px;
}

.rank-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rank-me-card {
  border-radius: 18px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #E8643C, #C94D28);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rank-me-card img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}

.rank-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.rank-list::-webkit-scrollbar { width: 5px; }
.rank-list::-webkit-scrollbar-thumb { background: rgba(120, 100, 89, 0.3); border-radius: 999px; }

.rank-row {
  border-radius: 16px;
  padding: 10px 12px;
  background: #FFFDF9;
  border: 1px solid #EAE0D4;
}
.rank-row.mine {
  background: #FFF6EA;
  border: 2px solid #E8643C;
}

.rank-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 900;
}

.rank-me-tag {
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 12px;
  color: #FFFFFF;
  background: #E8643C;
}

.rank-logout-link {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  margin-top: 4px;
  padding: 0;
}

.toast {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  padding: 8px 14px;
  border-radius: 999px;
  background: #3D2F28;
  color: #FFFDF9;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}
