:root {
  --gold: #d6ac5f;
  --gold-deep: #8d6220;
  --ink: #372312;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; width: 100%; height: 100%; overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #17110b 0%, #080808 55%, #020202 100%);
  color: #f4ead3; font-family: Georgia, 'Times New Roman', serif;
}
button, input { font: inherit; }
.app-shell { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.stage {
  position: relative; width: min(100vw, 177.777vh); aspect-ratio: 2048 / 1152; max-height: 100vh;
  overflow: hidden; box-shadow: 0 24px 64px rgba(0,0,0,0.65); user-select: none; perspective: 1500px;
}
.layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.machine-fx {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background:
    radial-gradient(circle at 50% 47%, rgba(255, 213, 120, 0.09), rgba(255, 213, 120, 0) 24%),
    radial-gradient(circle at 26% 36%, rgba(255, 213, 120, 0.16), rgba(255, 213, 120, 0) 13%),
    radial-gradient(circle at 74% 36%, rgba(255, 213, 120, 0.16), rgba(255, 213, 120, 0) 13%);
  mix-blend-mode: screen;
}
.eye-slot { position: absolute; top: 36.5%; width: 6.25%; height: 6.25%; overflow: visible; pointer-events: none; z-index: 1; transform: translate(-50%, -50%); }
.eye-slot-left { left: 45.9%; }
.eye-slot-right { left: 53.0%; }
.eye { position: absolute; width: 100%; height: auto; left: 50%; top: 50%; pointer-events: none; transform: translate(-50%, -50%); transform-origin: center; will-change: transform, opacity; }
.eye-left { }
.eye-right { }
.eye-glow { opacity: 0; mix-blend-mode: screen; filter: saturate(1.14) brightness(1.08); }
.body-layer { z-index: 2; }
.coin-layer {
  position: absolute; width: 3.48%; aspect-ratio: 1; left: 0; top: 0; transform: translate(-50%, -50%);
  pointer-events: none; z-index: 6; opacity: 0; will-change: left, top, transform, opacity;
}
.ramp-overlay-layer { z-index: 4; }
.mouth-layer { z-index: 5; transform-origin: 50% 50%; will-change: transform; }
.fortune-mover {
  position: absolute; width: 23.5%; aspect-ratio: 9 / 16; left: 86.95%; top: 79.55%; z-index: 19; opacity: 0; pointer-events: none;
  transform-origin: 50% 0%; transform: translate(-50%, 0) scale(0.19) rotateX(-64deg); clip-path: inset(0 0 100% 0);
  will-change: left, top, transform, opacity, clip-path;
}
.fortune-card-inner {
  width: 100%; height: 100%; border-radius: 18px; background: url('assets/card_background.png') center/cover no-repeat;
  color: var(--ink); box-shadow: 0 16px 28px rgba(0,0,0,0.32); position: relative; overflow: hidden;
}
.fortune-card-kicker { padding-top: 17.8%; text-align: center; font-size: clamp(11px, 0.62vw, 15px); letter-spacing: 0.17em; font-weight: 700; color: rgba(55,35,18,0.70); }
.fortune-card-title { padding-top: 3.2%; text-align: center; font-size: clamp(24px, 1.55vw, 42px); letter-spacing: 0.08em; font-weight: 700; color: rgba(55,35,18,0.94); }
.fortune-recipient { padding-top: 3.0%; text-align: center; font-size: clamp(15px, 0.90vw, 24px); letter-spacing: 0.16em; font-weight: 700; color: rgba(55,35,18,0.76); }
.fortune-divider { width: 68%; height: 1px; margin: 8.0% auto 0; background: linear-gradient(90deg, transparent, rgba(55,35,18,0.45), transparent); }
.fortune-card-text { width: 67%; margin: 10.8% auto 0; text-align: center; font-size: clamp(20px, 1.22vw, 34px); line-height: 1.22; color: rgba(48,31,16,0.95); }
.fortune-divider-bottom { margin-top: 7.2%; }
.fortune-footer { display: none; }
.fortune-website { position: absolute; left: 0; right: 0; bottom: 8.7%; text-align: center; font-size: clamp(12px, 0.64vw, 16px); letter-spacing: 0.08em; font-weight: 700; color: rgba(55,35,18,0.44); }
.share-overlay { position: absolute; inset: 0; z-index: 18; background: rgba(7, 5, 4, 0); opacity: 0; pointer-events: none; transition: opacity 360ms ease, background 360ms ease; }
.share-overlay.visible { opacity: 1; pointer-events: auto; background: rgba(7, 5, 4, 0.28); cursor: pointer; }
.share-actions { cursor: default; position: absolute; left: 50%; bottom: 1.1%; transform: translateX(-50%); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; z-index: 40; }
.share-action-btn, .ghost-button {
  appearance: none; border: 1px solid rgba(225, 182, 85, 0.7); border-radius: 999px; background: linear-gradient(180deg, #d8ac59 0%, #8c611f 100%);
  color: #1d1104; padding: 10px 18px; font-weight: 700; letter-spacing: 0.08em; cursor: pointer; box-shadow: 0 8px 18px rgba(0,0,0,0.35);
}
.ghost-button { background: rgba(24, 18, 11, 0.78); color: #f2dba5; }
.coin-hotspot { position: absolute; left: 0.6%; top: 0.6%; width: 23%; height: 86.8%; background: transparent; border: 0; cursor: pointer; z-index: 10; }
.machine-trigger {
  position: absolute;
  left: 8.9%;
  top: 76.8%;
  transform: translate(-50%, -50%);
  width: 3.2%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(225, 182, 85, 0.8);
  background: radial-gradient(circle at 35% 28%, #f3dd96 0%, #d3a33e 42%, #875b1d 100%);
  color: #1d1104;
  font-family: Georgia, serif;
  font-size: clamp(6px, 0.42vw, 10px);
  font-weight: 800;
  letter-spacing: 0.05em;
  cursor: pointer;
  z-index: 12;
  display: grid;
  place-items: center;
  text-align: center;
  box-shadow: inset 0 5px 10px rgba(255,255,255,0.20), inset 0 -7px 10px rgba(42,22,4,0.34), 0 6px 16px rgba(0,0,0,0.35);
}
.machine-trigger:hover { filter: brightness(1.06); }
.machine-trigger:active { transform: translate(-50%, -49%) scale(0.97); }
.machine-trigger:disabled { filter: grayscale(0.4) brightness(0.8); cursor: default; }
.marquee-message {
  position: absolute; left: 50%; top: 68.6%; transform: translate(-50%, -50%); width: 34%; text-align: center; font-size: clamp(14px, 1.08vw, 22px); letter-spacing: 0.15em; font-weight: 700; z-index: 14;
  color: rgba(22, 17, 12, 0.90); text-shadow: none; pointer-events: none; transition: color 260ms ease, text-shadow 260ms ease, opacity 260ms ease;
}
.marquee-message[data-mode="idle"] { color: rgba(22, 17, 12, 0.90); text-shadow: none; }
.marquee-message[data-mode="warm"] { color: #d9b160; text-shadow: 0 0 7px rgba(214,172,95,0.46), 0 0 18px rgba(214,172,95,0.26); }
.marquee-message[data-mode="bright"] { color: #f1cf86; text-shadow: 0 0 10px rgba(255,212,120,0.82), 0 0 28px rgba(255,212,120,0.38), 0 0 44px rgba(255,212,120,0.20); }
.marquee-message[data-mode="red"] { color: #f1cf86; text-shadow: 0 0 9px rgba(255,212,120,0.75), 0 0 24px rgba(255,0,0,0.18); }
.splash-overlay {
  position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
  background: rgba(6, 4, 3, 0.78); backdrop-filter: blur(4px); transition: opacity 260ms ease;
}
.splash-overlay.hidden { opacity: 0; pointer-events: none; visibility: hidden; }
.splash-panel { display:none; }
.splash-kicker { display:none; }
.splash-title { display:none; }
.splash-copy { display:none; }
.splash-label {
  display: block;
  margin: 0 0 8px;
  letter-spacing: 0.18em;
  font-size: 14px;
  color: #f0cd82;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0,0,0,0.9);
}
.splash-input {
  width: min(100%, 360px);
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(214,172,95,0.62);
  background: rgba(13, 8, 4, 0.76);
  color: #fff3d5;
  outline: none;
  font-size: 18px;
  text-align: center;
  box-shadow: inset 0 1px 10px rgba(0,0,0,0.42), 0 8px 20px rgba(0,0,0,0.36);
}
.splash-input:focus { border-color: rgba(241,207,134,0.84); box-shadow: 0 0 0 3px rgba(241,207,134,0.16); }
.fortune-count { display: none; }
.splash-button {
  margin-top: 10px;
  min-width: 210px;
  appearance: none;
  border: 1px solid rgba(225, 182, 85, 0.78);
  border-radius: 999px;
  background: linear-gradient(180deg, #d8ac59 0%, #8c611f 100%);
  color: #1d1104;
  padding: 11px 20px;
  font-weight: 800;
  letter-spacing: 0.10em;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0,0,0,0.40);
}
.splash-button:disabled { filter: grayscale(0.45) brightness(0.7); cursor: default; }
@media (max-width: 900px) {
  .marquee-message { width: 42%; top: 68.8%; font-size: clamp(11px, 1.8vw, 17px); }
  .share-actions { cursor: default; position: absolute; left: 50%; bottom: 1.1%; transform: translateX(-50%); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; z-index: 40; }
  .splash-panel { display:none; }
}

.disclaimer-button {
  position: absolute;
  right: 1.6%;
  bottom: 1.8%;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(225, 182, 85, 0.72);
  background: radial-gradient(circle at 35% 25%, #f0d992 0%, #cf9f39 38%, #855b1e 100%);
  color: #1d1104;
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  z-index: 22;
  box-shadow: inset 0 3px 7px rgba(255,255,255,0.18), inset 0 -5px 9px rgba(42,22,4,0.32), 0 5px 14px rgba(0,0,0,0.35);
}
.disclaimer-button:hover { filter: brightness(1.05); }
.disclaimer-button:active { transform: translateY(1px); }
.disclaimer-modal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 4, 3, 0.72);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  z-index: 700;
  transition: opacity 200ms ease;
}
.disclaimer-modal.visible {
  opacity: 1;
  pointer-events: auto;
}
.disclaimer-panel {
  position: relative;
  width: min(90vw, 620px);
  max-width: 620px;
  padding: 26px 28px 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(34,24,14,0.98), rgba(13,9,5,0.98));
  border: 1px solid rgba(214,172,95,0.42);
  box-shadow: 0 28px 60px rgba(0,0,0,0.5);
  text-align: left;
}
.disclaimer-kicker {
  color: #d9b160;
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}
.disclaimer-title {
  margin: 0 0 14px;
  color: #f1cf86;
  font-size: clamp(26px, 2.8vw, 38px);
}
.disclaimer-copy {
  margin: 0 0 12px;
  color: rgba(244,234,211,0.9);
  line-height: 1.48;
  font-size: 15px;
}
.disclaimer-close {
  position: absolute;
  right: 12px;
  top: 10px;
  border: 0;
  background: transparent;
  color: #f1cf86;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.disclaimer-ok {
  appearance: none;
  margin-top: 8px;
  border: 1px solid rgba(225, 182, 85, 0.7);
  border-radius: 999px;
  background: linear-gradient(180deg, #d8ac59 0%, #8c611f 100%);
  color: #1d1104;
  padding: 10px 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0,0,0,0.35);
}
@media (max-width: 900px) {
  .disclaimer-button { right: 2.8%; bottom: 2.8%; width: 28px; height: 28px; font-size: 16px; }
  .disclaimer-panel { width: 92vw; padding: 22px 18px 18px; }
  .disclaimer-copy { font-size: 14px; }
}

.splash-screen {
  background: url('assets/splash_screen_v112.png') center center / cover no-repeat;
  backdrop-filter: none;
}
.splash-backdrop {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4,3,2,0.10) 0%, rgba(4,3,2,0.18) 48%, rgba(4,3,2,0.44) 100%);
}
.splash-content {
  position: absolute;
  inset: 0;
  display: block;
}
.splash-form-wrap {
  position: absolute;
  left: 33.6%;
  top: 70.0%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(38vw, 360px);
  padding: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  border: 0;
  box-shadow: none;
  z-index: 2;
}
.splash-label {
  display: block;
  margin: 0 0 8px;
  letter-spacing: 0.18em;
  font-size: 14px;
  color: #f0cd82;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0,0,0,0.9);
}
.splash-input {
  width: min(100%, 360px);
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(214,172,95,0.62);
  background: rgba(13, 8, 4, 0.76);
  color: #fff3d5;
  outline: none;
  font-size: 18px;
  text-align: center;
  box-shadow: inset 0 1px 10px rgba(0,0,0,0.42), 0 8px 20px rgba(0,0,0,0.36);
}
.splash-input::placeholder { color: rgba(255,243,213,0.48); }
.splash-input:focus {
  border-color: rgba(241,207,134,0.95);
  box-shadow: 0 0 0 3px rgba(241,207,134,0.16), inset 0 1px 10px rgba(0,0,0,0.35);
}
.fortune-count { display: none; }
.splash-button {
  margin-top: 10px;
  min-width: 210px;
  appearance: none;
  border: 1px solid rgba(225, 182, 85, 0.78);
  border-radius: 999px;
  background: linear-gradient(180deg, #d8ac59 0%, #8c611f 100%);
  color: #1d1104;
  padding: 11px 18px;
  font-weight: 800;
  letter-spacing: 0.10em;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0,0,0,0.40);
}
.splash-button:disabled { filter: grayscale(0.45) brightness(0.68); cursor: default; }
@media (max-width: 900px) {
  .splash-content { display: block; }
  .splash-form-wrap {
  position: absolute;
  left: 33.6%;
  top: 70.0%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(38vw, 360px);
  padding: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  border: 0;
  box-shadow: none;
  z-index: 2;
}
  .splash-label {
  display: block;
  margin: 0 0 8px;
  letter-spacing: 0.18em;
  font-size: 14px;
  color: #f0cd82;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0,0,0,0.9);
}
  .splash-input {
  width: min(100%, 360px);
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(214,172,95,0.62);
  background: rgba(13, 8, 4, 0.76);
  color: #fff3d5;
  outline: none;
  font-size: 18px;
  text-align: center;
  box-shadow: inset 0 1px 10px rgba(0,0,0,0.42), 0 8px 20px rgba(0,0,0,0.36);
}
  .splash-button {
  margin-top: 10px;
  min-width: 210px;
  appearance: none;
  border: 1px solid rgba(225, 182, 85, 0.78);
  border-radius: 999px;
  background: linear-gradient(180deg, #d8ac59 0%, #8c611f 100%);
  color: #1d1104;
  padding: 11px 18px;
  font-weight: 800;
  letter-spacing: 0.10em;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0,0,0,0.40);
}
}

body.splash-mode .machine-trigger,
body.splash-mode .coin-hotspot { position: absolute; left: 0.6%; top: 0.6%; width: 23%; height: 86.8%; background: transparent; border: 0; cursor: pointer; z-index: 10; }
body.splash-mode .disclaimer-button {
  opacity: 0;
  pointer-events: none;
}

body.splash-mode .marquee-message {
  opacity: 0 !important;
}
body.splash-mode .splash-backdrop {
  background: linear-gradient(180deg, rgba(4,3,2,0.03) 0%, rgba(4,3,2,0.08) 50%, rgba(4,3,2,0.18) 100%);
}
@media (max-width: 900px) {
  .splash-form-wrap {
  position: absolute;
  left: 33.6%;
  top: 70.0%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(38vw, 360px);
  padding: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  border: 0;
  box-shadow: none;
  z-index: 2;
}
  .splash-input { width: min(100%, 330px); font-size: 16px; padding: 10px 12px; }
  .splash-button { min-width: 225px; font-size: 12px; padding: 10px 14px; }
}


.fullscreen-button {
  position: absolute;
  right: 2.1%;
  top: 2.1%;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(229, 190, 110, 0.55);
  background: rgba(12, 8, 4, 0.58);
  color: rgba(255, 238, 195, 0.92);
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  z-index: 80;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0,0,0,0.32);
  backdrop-filter: blur(3px);
}
.fullscreen-button:hover { filter: brightness(1.12); }
.fullscreen-button:active { transform: translateY(1px); }

.rotate-gate {
  position: absolute;
  inset: 0;
  z-index: 900;
  display: none;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 35%, rgba(96, 61, 22, 0.32), transparent 35%),
    rgba(6, 4, 2, 0.92);
  color: #f7d991;
  text-align: center;
  padding: 24px;
}
body.force-rotate .rotate-gate {
  display: flex;
}
.rotate-card {
  width: min(88vw, 430px);
  padding: 30px 24px 26px;
  border: 1px solid rgba(229, 190, 110, 0.35);
  border-radius: 24px;
  background: rgba(16, 10, 5, 0.72);
  box-shadow: 0 22px 50px rgba(0,0,0,0.45);
}
.rotate-icon {
  font-size: 54px;
  line-height: 1;
  margin-bottom: 14px;
}
.rotate-title {
  font-size: clamp(24px, 7vw, 36px);
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.rotate-copy {
  font-size: clamp(15px, 4.1vw, 19px);
  line-height: 1.35;
  color: rgba(255, 238, 195, 0.86);
}
.rotate-fullscreen-button {
  margin-top: 22px;
  border: 1px solid rgba(225, 182, 85, 0.78);
  border-radius: 999px;
  background: linear-gradient(180deg, #d8ac59 0%, #8c611f 100%);
  color: #1d1104;
  padding: 12px 20px;
  font-weight: 900;
  letter-spacing: 0.10em;
  cursor: pointer;
}
@media (max-width: 900px) {
  .fullscreen-button {
    right: 3.2%;
    top: 3.2%;
    width: 34px;
    height: 34px;
    font-size: 18px;
  }
}


/* Fortune production hardening */
.disclaimer-button { right: 4.1%; }
.privacy-note {
  width: min(100%, 360px);
  margin-top: 8px;
  color: rgba(255, 239, 201, 0.72);
  text-align: center;
  font: 600 11px/1.3 Arial, sans-serif;
  text-shadow: 0 2px 8px rgba(0,0,0,0.85);
}
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(255, 220, 145, 0.95);
  outline-offset: 3px;
}
.coin-hotspot { pointer-events: auto; }
@media (max-width: 900px) {
  .machine-trigger {
    left: 8.9%;
    top: 76.8%;
    width: 3.2%;
    font-size: clamp(5px, 0.42vw, 10px);
  }
  .privacy-note { font-size: 9px; width: min(100%, 310px); }
  .disclaimer-button { right: 8.5%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* V1.8 splash + top menu refresh */
.top-menu {
  position: absolute;
  left: 50%;
  top: 1.3%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  z-index: 500;
  pointer-events: auto;
}
.top-menu-btn {
  appearance: none;
  text-decoration: none;
  border: 2px solid #e3b451;
  background: linear-gradient(180deg, rgba(27,37,58,0.96) 0%, rgba(9,16,29,0.96) 100%);
  color: #fff2c8;
  padding: 11px 18px;
  min-width: 108px;
  text-align: center;
  border-radius: 4px;
  font: 900 clamp(12px,0.92vw,20px)/1.1 Arial, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 6px 14px rgba(0,0,0,0.32);
  cursor: pointer;
}
.top-menu-btn:hover { filter: brightness(1.08); }
.top-menu-btn:active { transform: translateY(1px); }
.top-menu-btn:focus-visible { outline: 3px solid rgba(255, 220, 145, 0.95); outline-offset: 3px; }
.splash-form-wrap {
  left: 29.5%;
  top: 78.2%;
  width: min(42vw, 470px);
}
.splash-label {
  margin-bottom: 10px;
  font-size: clamp(12px, 0.82vw, 18px);
  letter-spacing: 0.14em;
  color: #f5d68f;
}
.splash-input {
  width: min(100%, 420px);
  font-size: clamp(15px, 1vw, 20px);
  padding: 12px 14px;
  background: rgba(10, 9, 14, 0.78);
  border-color: rgba(224,184,92,0.68);
}
.splash-button {
  min-width: 180px;
  padding: 11px 22px;
}
.splash-backdrop {
  background: linear-gradient(180deg, rgba(4,3,2,0.06) 0%, rgba(4,3,2,0.10) 52%, rgba(4,3,2,0.34) 100%);
}
.disclaimer-panel {
  max-width: 700px;
}
.disclaimer-title {
  font-size: clamp(24px, 2.5vw, 36px);
}
.fullscreen-button, .disclaimer-button { display: none !important; }
@media (max-width: 1100px) {
  .top-menu { top: 1.2%; gap: 8px; }
  .top-menu-btn { min-width: 94px; padding: 9px 14px; font-size: clamp(10px,1.2vw,16px); }
  .splash-form-wrap { left: 30%; top: 80%; width: min(48vw, 400px); }
}
@media (max-width: 900px) {
  .top-menu {
    width: calc(100% - 20px);
    top: 1.4%;
    gap: 6px;
  }
  .top-menu-btn {
    min-width: 78px;
    padding: 8px 10px;
    font-size: 10px;
  }
  .splash-form-wrap {
    left: 30%;
    top: 82%;
    width: min(52vw, 320px);
  }
  .splash-input { width: min(100%, 300px); font-size: 14px; padding: 10px 12px; }
  .splash-button { min-width: 160px; padding: 10px 16px; font-size: 11px; }
}


/* V1.15: standard Just Xplored in-game arcade header.
   It is explicitly hidden on the splash screen and shown only after BEGIN. */
:root { --arcade-menu-height: 46px; }

.top-menu[hidden] { display: none !important; }

body:not(.splash-mode) .app-shell {
  height: calc(100% - var(--arcade-menu-height));
  margin-top: var(--arcade-menu-height);
  align-items: flex-start;
}

body:not(.splash-mode) .stage {
  width: min(100vw, calc((100vh - var(--arcade-menu-height)) * 1.7777778));
  max-height: calc(100vh - var(--arcade-menu-height));
}

.top-menu {
  position: fixed;
  inset: 0 0 auto 0;
  width: 100%;
  height: var(--arcade-menu-height);
  transform: none;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px 0 12px;
  z-index: 1500;
  overflow: hidden;
  background: linear-gradient(180deg, #2b2015 0%, #191109 53%, #080706 100%);
  border-top: 1px solid rgba(235, 190, 91, 0.35);
  border-bottom: 1px solid #d3a13c;
  box-shadow: 0 2px 8px rgba(0,0,0,0.72), inset 0 1px 0 rgba(255,230,168,0.13);
  pointer-events: auto;
}

body.splash-mode .top-menu { display: none !important; }

.top-menu-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f2ca71;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Narrow", sans-serif;
  font-size: clamp(12px, 0.92vw, 18px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 #000, 0 0 7px rgba(224,162,51,0.14);
}

.top-menu-separator {
  display: inline-block;
  margin: 0 0.38em;
  color: #bd832d;
}

.top-menu-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.top-menu-btn {
  appearance: none;
  width: auto;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid #e0ad45;
  border-radius: 2px;
  background: linear-gradient(180deg, #342514 0%, #171009 100%);
  color: #ffe49e;
  text-decoration: none;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,239,194,0.15), 0 2px 4px rgba(0,0,0,0.46);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Narrow", sans-serif;
  font-size: clamp(10px, 0.72vw, 13px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}

.top-menu-btn:hover {
  filter: brightness(1.13);
  background: linear-gradient(180deg, #4a3418 0%, #21150b 100%);
}
.top-menu-btn:active { transform: translateY(1px); }
.top-menu-btn:focus-visible { outline: 2px solid #fff1bc; outline-offset: 2px; }

@media (max-width: 980px), (max-height: 620px) {
  :root { --arcade-menu-height: 40px; }
  .top-menu { gap: 6px; padding: 0 4px 0 7px; }
  .top-menu-title { font-size: 10px; letter-spacing: 0.025em; }
  .top-menu-separator { margin: 0 0.22em; }
  .top-menu-actions { gap: 3px; }
  .top-menu-btn { padding: 5px 7px; font-size: 9px; }
}

@media (max-width: 720px) {
  .top-menu-title span:first-child,
  .top-menu-title span:first-child + .top-menu-separator { display: none; }
  .top-menu { padding-left: 4px; }
  .top-menu-btn { padding-inline: 5px; font-size: 8px; }
}


/* V2.1: clean startup, coin trigger, card clearance, and final visual layering */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(126, 78, 27, 0.26), transparent 28%),
    radial-gradient(circle at 50% 115%, rgba(170, 111, 31, 0.16), transparent 42%),
    linear-gradient(180deg, #100b07 0%, #080604 55%, #020202 100%);
  opacity: 1;
  visibility: visible;
  transition: opacity 520ms ease, visibility 520ms ease;
}
.loading-screen::before,
.loading-screen::after {
  content: "";
  position: absolute;
  inset: 5%;
  border: 1px solid rgba(212, 163, 74, 0.20);
  border-radius: 28px;
  pointer-events: none;
}
.loading-screen::after {
  inset: 7%;
  border-color: rgba(212, 163, 74, 0.08);
}
.loading-screen.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
body.loading-mode .app-shell { visibility: hidden; opacity: 0; }
.loading-panel { position: relative; z-index: 2; display: grid; justify-items: center; text-align: center; }
.loading-coin-wrap { position: relative; width: clamp(104px, 13vw, 176px); aspect-ratio: 1; perspective: 900px; }
.loading-coin {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-style: preserve-3d;
  backface-visibility: visible;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,0.55)) drop-shadow(0 0 18px rgba(218,167,74,0.25));
  animation: loadingCoinSpin 1.15s cubic-bezier(.45,.03,.55,.97) infinite;
}
.loading-coin-glow {
  position: absolute;
  left: 15%; right: 15%; bottom: -8%; height: 18%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(224, 167, 62, 0.34), rgba(224, 167, 62, 0));
  filter: blur(5px);
  animation: loadingGlow 1.15s ease-in-out infinite;
}
.loading-title {
  margin-top: 28px;
  color: #efcc79;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(28px, 4.2vw, 58px);
  letter-spacing: 0.075em;
  text-shadow: 0 2px 0 #000, 0 0 22px rgba(223, 162, 55, 0.22);
}
.loading-text {
  margin-top: 11px;
  color: rgba(255, 236, 190, 0.76);
  font: 800 clamp(12px, 1.15vw, 17px)/1 Arial, sans-serif;
  letter-spacing: 0.20em;
  min-height: 1em;
}
@keyframes loadingCoinSpin {
  0%   { transform: perspective(900px) rotateY(0deg) scaleX(1); }
  24%  { transform: perspective(900px) rotateY(88deg) scaleX(.18); }
  50%  { transform: perspective(900px) rotateY(180deg) scaleX(1); }
  76%  { transform: perspective(900px) rotateY(272deg) scaleX(.18); }
  100% { transform: perspective(900px) rotateY(360deg) scaleX(1); }
}
@keyframes loadingGlow { 0%,100% { opacity:.42; transform:scaleX(.88); } 50% { opacity:.9; transform:scaleX(1.12); } }

/* Preserve the original working stack: jaw below coin, ramp above coin. */
.coin-layer { width: 3.92%; z-index: 6 !important; }
.ramp-overlay-layer { z-index: 7; }
.mouth-layer { z-index: 5; }

/* The visible coin is the only gameplay start control. */
.coin-hotspot { pointer-events: none !important; }
.machine-trigger {
  left: 8.9%;
  top: 76.8%;
  width: 4.25%;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: transparent;
  box-shadow: none;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  transition: transform 150ms ease, opacity 300ms ease, filter 180ms ease;
  z-index: 16;
}
.machine-trigger img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 7px 10px rgba(0,0,0,0.48)) drop-shadow(0 0 8px rgba(231,191,104,0.18));
}
.machine-trigger:hover { filter: brightness(1.08); }
.machine-trigger:active,
.machine-trigger.pressed { transform: translate(-50%, -47%) scale(.89); }
.machine-trigger.fading { opacity: 0; transform: translate(-50%, -43%) scale(.77); }
.machine-trigger.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.machine-trigger:disabled { cursor: default; }
body.splash-mode .machine-trigger { opacity: 0 !important; visibility: hidden; pointer-events: none; }

/* Entire card now presents higher, while its text remains locked to the card. */
.fortune-card-kicker {
  padding-top: 23.4%;
  font-size: clamp(11px, 0.66vw, 16px);
  letter-spacing: 0.15em;
}
.fortune-card-title {
  padding-top: 2.7%;
  font-size: clamp(23px, 1.46vw, 40px);
}
.fortune-recipient {
  padding-top: 2.5%;
  font-size: clamp(14px, 0.86vw, 23px);
}
.fortune-divider { margin-top: 6.7%; }
.fortune-card-text { margin-top: 8.9%; }
.fortune-divider-bottom { margin-top: 6.2%; }

/* Controls sit on their own top interaction layer and cannot be hidden by the card. */
.share-overlay { z-index: 25; background: transparent !important; }
.share-overlay.visible { background: transparent !important; }
.share-actions { bottom: 2.1%; z-index: 60; }
.share-action-btn, .ghost-button { min-height: 42px; }

@media (max-width: 900px), (max-height: 620px) {
  .machine-trigger { width: 4.5%; }
  .share-actions { bottom: 1.4%; gap: 7px; }
  .share-action-btn, .ghost-button { padding: 8px 13px; min-height: 36px; font-size: 10px; }
  .fortune-card-kicker { font-size: clamp(8px, 1.1vw, 12px); }
}

/* V2.1 mobile card typography: scale with the physical card instead of desktop minimums. */
@media (max-width: 900px), (max-height: 620px) {
  .fortune-card-kicker {
    padding-top: 23.4%;
    font-size: clamp(5px, 0.75vw, 7px) !important;
    letter-spacing: 0.11em;
    white-space: nowrap;
  }
  .fortune-card-title {
    padding-top: 2.5%;
    font-size: clamp(11px, 1.7vw, 15px) !important;
    letter-spacing: 0.055em;
    white-space: nowrap;
  }
  .fortune-recipient {
    padding-top: 2.2%;
    font-size: clamp(7px, 0.92vw, 9px) !important;
    letter-spacing: 0.13em;
    white-space: nowrap;
  }
  .fortune-divider { margin-top: 5.3%; }
  .fortune-card-text {
    width: 72%;
    margin-top: 7.2% !important;
    font-size: clamp(8px, 1.1vw, 10.5px) !important;
    line-height: 1.18 !important;
  }
  .fortune-divider-bottom { margin-top: 4.8%; }
  .fortune-website { font-size: clamp(4.5px, 0.65vw, 6px); }
}
