/* =========================================================
   fruit.css  –  Neon Vegas Fruit Machine
   BEM naming: block__element--modifier
   ========================================================= */

/* ---------- Design Tokens ---------- */
:root {
  --fruit-bg:           #0a0a12;
  --fruit-machine-bg:   #12121e;
  --fruit-gold:         #ffd700;
  --fruit-gold-dark:    #b8860b;
  --fruit-neon-pink:    #ff2d78;
  --fruit-neon-cyan:    #00e5ff;
  --fruit-neon-green:   #39ff14;
  --fruit-reel-bg:      #1a1a2e;
  --fruit-reel-border:  #ffd700;
  --fruit-btn-bg:       #ff2d78;
  --fruit-btn-hover:    #ff5599;
  --fruit-text:         #ffffff;
  --fruit-shadow-gold:  0 0 18px #ffd700, 0 0 36px #b8860b;
  --fruit-shadow-pink:  0 0 16px #ff2d78, 0 0 32px #ff005588;
  --fruit-shadow-cyan:  0 0 16px #00e5ff, 0 0 32px #00e5ff88;
  --fruit-radius:       16px;
  /* Scales with viewport height (and width on narrow phones) — no scroll needed */
  --fruit-reel-size:    clamp(78px, min(14dvh, 21vw), 140px);
  /* Icon is 63 % of the cell — defined as its own token to avoid nested calc() */
  --fruit-icon-size:    clamp(49px, min(8.8dvh, 13.2vw), 88px);
  /* Coffee claim palette */
  --fruit-coffee:       #c07a20;
  --fruit-coffee-dark:  #7a4a0a;
  --fruit-claim-bg:     #ffffff;
}

/* ---------- Reset / Base ---------- */
.fruit-page {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;            /* no page-level scroll */
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--fruit-bg);
  background-image:
    radial-gradient(ellipse at 20% 30%, #1a003388 0%, transparent 55%),
    radial-gradient(ellipse at 80% 70%, #00003388 0%, transparent 55%);
  font-family: 'Segoe UI', 'Arial', sans-serif;
  margin: 0;
  padding: clamp(8px, 2dvh, 20px) clamp(10px, 2vw, 20px);
  box-sizing: border-box;
}

/* ---------- Machine Cabinet ---------- */
.fruit-machine {
  background: var(--fruit-machine-bg);
  border: none;
  border-radius: 28px;
  box-shadow: inset 0 0 60px #00000099;
  padding: clamp(14px, 2.5dvh, 36px) clamp(18px, 3.5vw, 40px) clamp(12px, 2dvh, 32px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.8dvh, 24px);
  max-width: 520px;
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* ---------- Title ---------- */
.fruit-machine__title {
  visibility: hidden;
  font-size: clamp(1.1rem, 4vmin, 2rem);
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fruit-gold);
  text-shadow: var(--fruit-shadow-gold);
  margin: 0;
  text-align: center;
}

.fruit-machine__title span {
  color: var(--fruit-neon-pink);
  text-shadow: var(--fruit-shadow-pink);
}

/* ---------- Reel Window ---------- */
.fruit-machine__window {
  border: 4px solid var(--fruit-gold);
  border-radius: var(--fruit-radius);
  box-shadow: var(--fruit-shadow-gold), inset 0 0 30px #00000088;
  background: #0d0d1a;
  padding: 12px;
  display: flex;
  gap: 12px;
  position: relative;
}

.fruit-machine__window::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: calc(var(--fruit-radius) - 2px);
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 30%, transparent 70%, rgba(0,0,0,0.2) 100%);
  pointer-events: none;
  z-index: 6;
}

/* ---------- Individual Reel ---------- */
.fruit-reel {
  width: var(--fruit-reel-size);
  height: calc(var(--fruit-reel-size) * 2);   /* 1 full symbol + half above/below */
  background: var(--fruit-reel-bg);
  border: 2px solid #2a2a4a;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

/* Dim overlay on top half-row */
.fruit-reel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: calc(var(--fruit-reel-size) * 0.5);
  background: rgba(10, 10, 20, 0.55);
  pointer-events: none;
  z-index: 5;
  transition: background 0.3s ease;
}

/* Dim overlay on bottom half-row */
.fruit-reel::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--fruit-reel-size) * 0.5);
  background: rgba(10, 10, 20, 0.55);
  pointer-events: none;
  z-index: 5;
  transition: background 0.3s ease;
}

/* Lift dim on win — half-row overlays get a green tint */
.fruit-reel--win::before,
.fruit-reel--win::after {
  background: rgba(57, 255, 20, 0.08);
}

.fruit-reel__strip {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  will-change: transform;
}

.fruit-reel__symbol {
  width: var(--fruit-reel-size);
  height: var(--fruit-reel-size);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fruit-reel__symbol img {
  width: var(--fruit-icon-size);
  height: var(--fruit-icon-size);
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6));
  user-select: none;
  pointer-events: none;
  background: transparent;
}

/* Reel win highlight */
.fruit-reel--win {
  border-color: var(--fruit-neon-green);
  box-shadow: 0 0 18px var(--fruit-neon-green), inset 0 0 20px rgba(57,255,20,0.15);
  animation: fruit-reel-pulse 0.6s ease-in-out infinite alternate;
}

/* ---------- Payline ---------- */
/* top: 50% centres on middle row of the 3-row window */
.fruit-machine__payline {
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 3px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent 0%, var(--fruit-neon-pink) 15%, var(--fruit-neon-pink) 85%, transparent 100%);
  box-shadow: var(--fruit-shadow-pink);
  opacity: 0.8;
  pointer-events: none;
  z-index: 10;
}

/* ---------- Nudge area (score moved above reels) ---------- */
.fruit-machine__score-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* ---------- Score Panel ---------- */
.fruit-machine__scoreboard {
  display: flex;
  gap: 32px;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease;
}


.fruit-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.fruit-score__label {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #888;
  font-weight: 600;
}

.fruit-score__value {
  font-size: clamp(1.5rem, 4.5vmin, 2.4rem);
  font-weight: 900;
  color: var(--fruit-gold);
  text-shadow: var(--fruit-shadow-gold);
  font-variant-numeric: tabular-nums;
  min-width: 3ch;
  text-align: center;
  transition: transform 0.15s ease, color 0.15s ease;
}

.fruit-score__value--bump {
  transform: scale(1.4);
  color: var(--fruit-neon-green);
  text-shadow: 0 0 18px var(--fruit-neon-green);
}

/* Divider dot */
.fruit-machine__scoreboard-divider {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fruit-gold);
  box-shadow: var(--fruit-shadow-gold);
  opacity: 0.6;
}

/* ---------- Credit display ---------- */
.fruit-machine__credits {
  display: none;   /* removed — saves vertical space */
}

/* ---------- Spin Button ---------- */
.fruit-machine__btn {
  background: linear-gradient(145deg, var(--fruit-btn-bg), #c2185b);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: clamp(9px, 1.6dvh, 14px) clamp(32px, 6vw, 52px);
  font-size: clamp(0.9rem, 2.5vmin, 1.1rem);
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--fruit-shadow-pink), 0 4px 16px rgba(0,0,0,0.5);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  position: relative;
  overflow: hidden;
}

.fruit-machine__btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transition: left 0.4s ease;
}

.fruit-machine__btn:hover::before { left: 160%; }

.fruit-machine__btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 28px var(--fruit-neon-pink), 0 6px 24px rgba(0,0,0,0.5);
  background: linear-gradient(145deg, var(--fruit-btn-hover), #e91e63);
}

.fruit-machine__btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
}

.fruit-machine__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Message Banner ---------- */
.fruit-machine__message {
  min-height: 0;
  font-size: clamp(0.78rem, 4vw, 1.4rem);
  font-weight: 900;
  letter-spacing: clamp(0.04em, 0.8vw, 0.12em);
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;        /* never wrap — scales down via clamp instead */
  overflow: hidden;
  max-width: 100%;
  color: transparent;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.fruit-machine__message--visible {
  opacity: 1;
  transform: scale(1);
}

.fruit-machine__message--win {
  color: var(--fruit-neon-green);
  text-shadow: 0 0 20px var(--fruit-neon-green), 0 0 40px var(--fruit-neon-green);
  animation: fruit-message-bounce 0.5s ease infinite alternate;
}


/* ---------- Nudge Row ---------- */
/* Hidden via visibility+opacity so pointer events are blocked when inactive. */
.fruit-machine__nudge-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 2dvh, 20px);
  width: 100%;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.fruit-machine__nudge-row--visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* When nudges are active — hide SPIN without removing it from layout (prevents height jump) */
.fruit-machine--nudging .fruit-machine__btn {
  visibility: hidden;
  pointer-events: none;
}

.fruit-machine__nudge-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.fruit-machine__nudge-count {
  font-size: clamp(1.2rem, 3.5vmin, 2rem);
  font-weight: 900;
  color: var(--fruit-neon-cyan);
  text-shadow: var(--fruit-shadow-cyan);
  font-variant-numeric: tabular-nums;
  min-width: 1.5ch;
  text-align: center;
  transition: transform 0.15s ease;
}

.fruit-machine__nudge-label {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #888;
  font-weight: 600;
}

/* Three nudge groups aligned under the reels */
.fruit-machine__nudge-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* One nudge group (up + down) per reel */
.fruit-nudge {
  width: var(--fruit-reel-size);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 2.5dvh, 24px);
}

.fruit-nudge__btn {
  background: linear-gradient(145deg, #006a80, #004455);
  color: var(--fruit-neon-cyan);
  border: 1px solid var(--fruit-neon-cyan);
  border-radius: 10px;
  width: 100%;
  height: clamp(46px, 6.5dvh, 60px);
  font-size: clamp(1rem, 3vmin, 1.3rem);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0,229,255,0.4);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
  line-height: 1;
}

.fruit-nudge__btn:hover {
  background: linear-gradient(145deg, #0099bb, #005f77);
  box-shadow: var(--fruit-shadow-cyan);
  transform: scale(1.1);
}

.fruit-nudge__btn:active {
  transform: scale(0.93);
}

/* ---------- Win Flash Overlay ---------- */
.fruit-machine__flash {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  background: var(--fruit-neon-green);
  opacity: 0;
  pointer-events: none;
  z-index: 20;
}

.fruit-machine__flash--active {
  animation: fruit-flash 0.8s ease-out forwards;
}

/* ---------- Coin Burst ---------- */
.fruit-coin {
  position: absolute;
  font-size: 1.4rem;
  pointer-events: none;
  z-index: 30;
  animation: fruit-coin-fly var(--fruit-coin-duration, 1s) ease-out forwards;
  top: 50%;
  left: 50%;
}

/* ---------- Animations ---------- */
@keyframes fruit-scan {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes fruit-reel-pulse {
  from { box-shadow: 0 0 10px var(--fruit-neon-green), inset 0 0 10px rgba(57,255,20,0.1); }
  to   { box-shadow: 0 0 30px var(--fruit-neon-green), inset 0 0 30px rgba(57,255,20,0.25); }
}

@keyframes fruit-message-bounce {
  from { transform: scale(1); }
  to   { transform: scale(1.06); }
}

@keyframes fruit-flash {
  0%   { opacity: 0.35; }
  100% { opacity: 0; }
}

@keyframes fruit-coin-fly {
  0%   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(
    calc(-50% + var(--fruit-coin-x, 0px)),
    calc(-50% + var(--fruit-coin-y, -120px))
  ) scale(0.3); opacity: 0; }
}


/* ---------- Responsive ---------- */
/* clamp() + dvh handles most cases; this catches very narrow phones */
@media (max-width: 380px) {
  .fruit-machine__window {
    padding: 8px;
    gap: 8px;
  }
  .fruit-machine__nudge-controls { gap: 8px; }
}


/* =========================================================
   Claim Free Coffee overlay
   Triggered when 3 coffee cups land on the payline.
   Sits outside <main> (fixed, full-viewport) so the
   machine's overflow:hidden does not clip it.
   ========================================================= */

/* ---------- Spin button — claim state modifier ---------- */
.fruit-machine__btn--claim {
  background: linear-gradient(145deg, var(--fruit-coffee), var(--fruit-coffee-dark));
  box-shadow: 0 0 18px var(--fruit-coffee), 0 0 36px #7a4a0a88, 0 4px 16px rgba(0,0,0,0.5);
  letter-spacing: 0.12em;
}
.fruit-machine__btn--claim:hover:not(:disabled) {
  background: linear-gradient(145deg, #d4901e, #9a5f10);
  box-shadow: 0 0 28px #d4901e, 0 6px 24px rgba(0,0,0,0.5);
  transform: translateY(-2px) scale(1.03);
}

/* ---------- Full-page white overlay ---------- */
.fruit-claim {
  position: fixed;
  inset: 0;
  background: var(--fruit-claim-bg);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  z-index: 100;
  overflow-y: auto;
  padding: 24px 24px calc(24px + env(safe-area-inset-bottom, 20px));
  box-sizing: border-box;
}

.fruit-claim--visible {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Panel + success shared layout ---------- */
.fruit-claim__panel,
.fruit-claim__success {
  max-width: 420px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 2dvh, 16px);
  text-align: center;
  font-family: 'Segoe UI', 'Arial', sans-serif;
  margin: auto;
}

.fruit-claim__venue {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fruit-coffee);
  margin: 0;
}

.fruit-claim__logo {
  max-width: clamp(160px, 55vw, 260px);
  max-height: clamp(80px, 18vh, 130px);
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 3px 14px rgba(0, 0, 0, 0.12));
}

.fruit-claim__hero {
  width: 110px;
  height: 110px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(192, 122, 32, 0.35));
}

.fruit-claim__heading {
  font-size: 1.6rem;
  font-weight: 900;
  color: #1a1a1a;
  margin: 0;
}

.fruit-claim__sub {
  font-size: 0.95rem;
  color: #555;
  margin: 0;
}

/* ---------- Form ---------- */
.fruit-claim__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  text-align: left;
}

.fruit-claim__label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #333;
}

.fruit-claim__input {
  border: 2px solid #ddd;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 1rem;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
  background: #fafafa;
  color: #1a1a1a;
}

.fruit-claim__input:focus {
  border-color: var(--fruit-coffee);
}

.fruit-claim__input--error {
  border-color: #e53935;
}

/* ---------- Checkboxes ---------- */
.fruit-claim__check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
}

.fruit-claim__check-input {
  margin-top: 3px;
  accent-color: var(--fruit-coffee);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}

.fruit-claim__check-label {
  font-size: 0.85rem;
  color: #444;
  line-height: 1.4;
}

.fruit-claim__link {
  color: var(--fruit-coffee);
  text-decoration: underline;
}

/* ---------- Inline validation errors ---------- */
.fruit-claim__error {
  font-size: 0.8rem;
  color: #e53935;
  min-height: 1em;
  margin-top: -4px;
}

/* ---------- API-level error (shown inside the claim overlay) ---------- */
.fruit-claim__api-error {
  background: #fff3f3;
  border: 1px solid #f5c6c6;
  border-radius: 8px;
  color: #c0392b;
  font-size: 0.88rem;
  line-height: 1.4;
  margin: 0;
  padding: 10px 14px;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

/* ---------- Submit button ---------- */
.fruit-claim__btn {
  background: linear-gradient(145deg, var(--fruit-coffee), var(--fruit-coffee-dark));
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  width: 100%;
  margin-top: 6px;
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 4px 16px rgba(192, 122, 32, 0.4);
}

.fruit-claim__btn:hover {
  background: linear-gradient(145deg, #d4901e, #9a5f10);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(192, 122, 32, 0.5);
}

.fruit-claim__btn:active {
  transform: translateY(1px);
}

/* ---------- Success screen — backup code ---------- */
.fruit-claim__code {
  font-size: clamp(1rem, 3.5vw, 1.3rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--fruit-coffee);
  background: #fff8ee;
  border: 2px dashed var(--fruit-coffee);
  border-radius: 10px;
  padding: 10px 20px;
  font-family: 'Courier New', Courier, monospace;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}

/* ---------- QR code canvas ---------- */
.fruit-claim__qr {
  display: block;
  width: min(200px, 52vw);
  height: min(200px, 52vw);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
  border: 6px solid #fff;
  background: #fff;
}

/* ---------- Backup code label ---------- */
.fruit-claim__code-label {
  font-size: 0.8rem;
  color: #888;
  margin: 0;
  letter-spacing: 0.04em;
}

/* ---------- Valid until ---------- */
.fruit-claim__valid-until {
  font-size: 0.78rem;
  color: #aaa;
  margin: -4px 0 0;
}

/* ---------- Save to Photos button ---------- */
.fruit-claim__save-btn {
  background: linear-gradient(145deg, var(--fruit-coffee), var(--fruit-coffee-dark));
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  width: 100%;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 4px 16px rgba(192, 122, 32, 0.4);
}

.fruit-claim__save-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(192, 122, 32, 0.5);
}

.fruit-claim__save-btn:active {
  transform: translateY(1px);
}

.fruit-claim__save-btn:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

/* ---------- Close button ---------- */
.fruit-claim__close-btn {
  background: none;
  border: 2px solid #ddd;
  color: #888;
  border-radius: 50px;
  padding: 9px 28px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
  letter-spacing: 0.08em;
  width: 100%;
}

.fruit-claim__close-btn:hover {
  border-color: #aaa;
  color: #555;
}

/* ---------- Footer links (T&C / Privacy) ---------- */
.fruit-claim__footer {
  font-size: 0.72rem;
  color: #ccc;
  margin: 4px 0 0;
  text-align: center;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.fruit-claim__footer-link {
  background: none;
  border: none;
  color: #aaa;
  font-size: 0.72rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  transition: color 0.15s ease;
}

.fruit-claim__footer-link:hover {
  color: var(--fruit-coffee);
}

/* Also style the inline checkbox T&C links as button-links */
.fruit-claim__link {
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
  cursor: pointer;
}

/* Ensure the hidden attribute works correctly even when display:flex is set */
.fruit-claim__panel[hidden],
.fruit-claim__success[hidden] {
  display: none;
}


/* =========================================================
   Legal modals (Terms & Conditions / Privacy Policy)
   z-index 300 — sits above the claim overlay (200)
   ========================================================= */

.fruit-legal {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.fruit-legal[hidden] {
  display: none;
}

.fruit-legal__box {
  background: #fff;
  border-radius: 16px;
  max-width: 480px;
  width: 100%;
  max-height: 80dvh;
  overflow-y: auto;
  padding: 28px 24px 24px;
  position: relative;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

.fruit-legal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.1rem;
  color: #999;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.fruit-legal__close:hover {
  background: #f0f0f0;
  color: #333;
}

.fruit-legal__heading {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--fruit-coffee);
  margin: 0 0 16px;
  padding-right: 32px;
  font-family: 'Segoe UI', 'Arial', sans-serif;
}

.fruit-legal__body {
  font-size: 0.85rem;
  color: #444;
  line-height: 1.65;
  font-family: 'Segoe UI', 'Arial', sans-serif;
}

.fruit-legal__body h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #222;
  margin: 0 0 12px;
}

.fruit-legal__body p {
  margin: 0 0 10px;
}

.fruit-legal__body p:last-child {
  margin-bottom: 0;
}


/* =========================================================
   Daily spin limit modal
   ========================================================= */

.fruit-limit {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.fruit-limit:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}

.fruit-limit[hidden] {
  display: none;
}

.fruit-limit__box {
  background: #12121e;
  border: 2px solid var(--fruit-gold);
  box-shadow: var(--fruit-shadow-gold), 0 12px 48px rgba(0,0,0,0.7);
  border-radius: 20px;
  max-width: 360px;
  width: 100%;
  padding: 36px 28px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-family: 'Segoe UI', 'Arial', sans-serif;
}

.fruit-limit__icon {
  font-size: 3rem;
  line-height: 1;
}

.fruit-limit__heading {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--fruit-gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
}

.fruit-limit__sub {
  font-size: 0.9rem;
  color: #aaa;
  margin: 0;
}

.fruit-limit__until {
  font-size: 0.95rem;
  color: #ccc;
  margin: 4px 0 0;
}

.fruit-limit__until strong {
  color: var(--fruit-neon-cyan);
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

.fruit-limit__date {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.fruit-limit__share-label {
  font-size: 0.85rem;
  color: #aaa;
  margin: 4px 0 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.fruit-limit__social-row {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-top: 4px;
}

.fruit-limit__social-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 13px 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.1s ease;
  color: #fff;
}

.fruit-limit__social-btn:active {
  transform: scale(0.96);
}

.fruit-limit__social-btn:hover {
  filter: brightness(1.15);
}

.fruit-limit__social-btn--fb {
  background: #1877f2;
}

.fruit-limit__social-btn--x {
  background: #000;
  border: 1px solid #333;
}

.fruit-limit__social-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.fruit-limit__close-btn {
  background: none;
  border: 1px solid #444;
  color: #888;
  border-radius: 50px;
  padding: 10px 28px;
  font-size: 0.85rem;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.fruit-limit__close-btn:hover {
  border-color: #888;
  color: #ccc;
}


/* =========================================================
   Intro splash screen
   Full-viewport warm coffee-shop branded welcome.
   Transitions from warm parchment → dark neon game on dismiss.
   ========================================================= */

/* ---------- Overlay ---------- */
.fruit-intro {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: linear-gradient(175deg, #fdf8ef 0%, #f7edda 40%, #f0e0c0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s ease;
  transform: translateZ(0);
  will-change: opacity;
}

.fruit-intro--dismissed {
  opacity: 0;
  pointer-events: none;
}

.fruit-intro[hidden] {
  display: none;
}

/* ---------- Inner container — full-bleed on mobile ---------- */
.fruit-intro__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: clamp(16px, 3.5dvh, 32px);
  text-align: center;
  width: 100%;
  min-height: 100dvh;
  max-width: 100%;
  padding: clamp(40px, 9dvh, 72px) clamp(28px, 7vw, 56px) calc(clamp(32px, 6dvh, 52px) + env(safe-area-inset-bottom, 0px) + 90px);
  background: transparent;
  animation: fruit-intro-fade-up 0.45s ease both;
}

/* ---------- Brand zone: logo or shop name ---------- */
.fruit-intro__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  flex: 1;
  justify-content: center;
  width: 100%;
}

/* ---------- Logo ---------- */
.fruit-intro__logo {
  max-width: clamp(260px, 82vw, 400px);
  max-height: clamp(200px, 42dvh, 320px);
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 20px rgba(28, 13, 5, 0.18));
}

/* ---------- Venue name (shown when no logo) ---------- */
.fruit-intro__venue {
  font-size: clamp(2rem, 8vmin, 3.2rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1c0d05;
  margin: 0;
  line-height: 1.1;
  text-shadow: none;
  animation: none;
}

/* ---------- Horizontal rules ---------- */
.fruit-intro__rule {
  height: 1px;
  width: min(280px, 75vw);
  background: linear-gradient(90deg, transparent, #c9925a 30%, #c9925a 70%, transparent);
  border-radius: 2px;
  animation: none;
  flex-shrink: 0;
}

/* ---------- Info zone: badge · date · tagline ---------- */
.fruit-intro__info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 1.8dvh, 16px);
}

/* ---------- "Free to Play" badge ---------- */
.fruit-intro__welcome {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #fdf8ef;
  background: #1c0d05;
  padding: 0.32rem 1.1rem;
  border-radius: 999px;
  margin: 0;
  animation: none;
}

/* ---------- Date ---------- */
.fruit-intro__date {
  font-size: clamp(0.82rem, 2.2vmin, 0.95rem);
  letter-spacing: 0.06em;
  color: #6b4423;
  margin: 0;
  font-style: italic;
}

/* ---------- Tagline ---------- */
.fruit-intro__luck {
  font-size: clamp(1rem, 3vmin, 1.2rem);
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #4a2c0f;
  margin: 0;
  text-shadow: none;
  animation: none;
}

/* ---------- Play Now button ---------- */
.fruit-intro__btn {
  background: linear-gradient(145deg, #1c0d05, #3d1a08);
  color: #fdf8ef;
  border: none;
  border-radius: 50px;
  padding: clamp(14px, 2.2dvh, 18px) clamp(32px, 6vw, 52px);
  font-size: clamp(1rem, 2.8vmin, 1.15rem);
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  width: min(340px, 100%);
  box-shadow: 0 6px 28px rgba(28, 13, 5, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  flex-shrink: 0;
}

.fruit-intro__btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 36px rgba(28, 13, 5, 0.45);
}

.fruit-intro__btn:active {
  transform: translateY(1px) scale(0.98);
}

/* ---------- Footer links ---------- */
.fruit-intro__footer {
  font-size: 0.72rem;
  color: #a06040;
  margin: 0;
  letter-spacing: 0.04em;
  padding-bottom: max(0px, calc(env(safe-area-inset-bottom, 20px) - 30px));
}

.fruit-intro__footer-link {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.72rem;
  color: #a06040;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  transition: color 0.15s ease;
}

.fruit-intro__footer-link:hover {
  color: #1c0d05;
}

/* ---------- Desktop: elegant centred card ---------- */
@media (min-width: 600px) {
  .fruit-intro__inner {
    min-height: auto;
    max-width: 460px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(28, 13, 5, 0.2);
    padding: 3.5rem 2.5rem;
    justify-content: center;
    gap: clamp(20px, 3dvh, 36px);
  }
  .fruit-intro__brand { flex: none; }
}

/* ---------- Geofence overlay ---------- */
/*
   Full-viewport warm cream screen shown when the player is outside
   the shop's allowed geofence radius.  Sits above every other layer
   (z-index 500) and cannot be dismissed — the player must visit the
   shop physically.  Shares the same parchment palette as fruit-intro.
*/
.fruit-fence {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: linear-gradient(175deg, #fdf8ef 0%, #f7edda 40%, #f0e0c0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px calc(32px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  overflow-y: auto;
}

.fruit-fence[hidden] {
  display: none;
}

.fruit-fence__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(14px, 3dvh, 28px);
  text-align: center;
  max-width: 420px;
  width: 100%;
  animation: fruit-intro-fade-up 0.5s ease both;
}

.fruit-fence__logo {
  max-width: clamp(180px, 65vw, 300px);
  max-height: clamp(110px, 25dvh, 200px);
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 18px rgba(28, 13, 5, 0.15));
}

.fruit-fence__venue {
  font-size: clamp(1.8rem, 7vmin, 2.8rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1c0d05;
  margin: 0;
  line-height: 1.1;
}

.fruit-fence__rule {
  height: 1px;
  width: min(260px, 70vw);
  background: linear-gradient(90deg, transparent, #c9925a 30%, #c9925a 70%, transparent);
  border-radius: 2px;
  flex-shrink: 0;
}

.fruit-fence__cup {
  font-size: clamp(3.5rem, 12vmin, 5.5rem);
  line-height: 1;
  animation: fruit-fence-bob 2.2s ease-in-out infinite;
}

.fruit-fence__heading {
  font-size: clamp(1.35rem, 4.8vmin, 2rem);
  font-weight: 900;
  color: #1c0d05;
  margin: 0;
  letter-spacing: 0.02em;
}

.fruit-fence__body {
  font-size: clamp(1rem, 3vmin, 1.2rem);
  color: #6b4423;
  font-weight: 500;
  font-style: italic;
  margin: 0;
  line-height: 1.6;
}

.fruit-fence__hint {
  font-size: 0.8rem;
  color: #a06040;
  margin: 0;
  letter-spacing: 0.03em;
  min-height: 1.1em;
}

@keyframes fruit-fence-bob {
  0%, 100% { transform: translateY(0);    }
  50%       { transform: translateY(-10px); }
}

/* ---------- Keyframe ---------- */
@keyframes fruit-intro-fade-up {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================
   Desktop info screen
   Shown instead of the game on non-touch (desktop) devices.
   Shares the warm parchment palette of fruit-intro/fruit-fence.
   ========================================================== */

.fruit-desktop {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: linear-gradient(175deg, #fdf8ef 0%, #f7edda 40%, #f0e0c0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px calc(40px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  overflow-y: auto;
}

.fruit-desktop[hidden] {
  display: none;
}

.fruit-desktop__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 2.8dvh, 32px);
  text-align: center;
  max-width: 480px;
  width: 100%;
  animation: fruit-intro-fade-up 0.5s ease both;
}

.fruit-desktop__logo {
  max-width: clamp(180px, 55vw, 280px);
  max-height: clamp(100px, 22dvh, 180px);
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 18px rgba(28, 13, 5, 0.15));
}

.fruit-desktop__name {
  font-size: clamp(1.8rem, 6vmin, 2.6rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #1c0d05;
  text-transform: uppercase;
  margin: 0;
  line-height: 1.1;
}

.fruit-desktop__rule {
  height: 1px;
  width: min(280px, 75vw);
  background: linear-gradient(90deg, transparent, #c9925a 30%, #c9925a 70%, transparent);
  flex-shrink: 0;
}

.fruit-desktop__phone-icon {
  width: clamp(40px, 10vmin, 64px);
  height: clamp(40px, 10vmin, 64px);
  color: #c07a20;
  flex-shrink: 0;
}

.fruit-desktop__phone-icon svg {
  width: 100%;
  height: 100%;
}

.fruit-desktop__heading {
  font-size: clamp(1.3rem, 4.5vmin, 2rem);
  font-weight: 900;
  color: #1c0d05;
  margin: 0;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.fruit-desktop__sub {
  font-size: clamp(0.95rem, 2.8vmin, 1.15rem);
  color: #6b4423;
  font-weight: 500;
  margin: 0;
  line-height: 1.5;
}

.fruit-desktop__qr-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 18px;
  box-shadow:
    0 4px 20px rgba(100, 50, 10, 0.18),
    0 1px 4px rgba(100, 50, 10, 0.10);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.fruit-desktop__qr {
  display: block;
  width: clamp(160px, 42vmin, 220px);
  height: clamp(160px, 42vmin, 220px);
  border-radius: 4px;
}

.fruit-desktop__contacts {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-height: 1px;
}

.fruit-desktop__contact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(0.9rem, 2.6vmin, 1.05rem);
  color: #6b4423;
  font-weight: 500;
}

.fruit-desktop__contact-row svg {
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
  color: #c07a20;
}

.fruit-desktop__contact-link {
  color: #6b4423;
  text-decoration: none;
  border-bottom: 1px solid #c9925a55;
  transition: color 0.15s, border-color 0.15s;
}

.fruit-desktop__contact-link:hover {
  color: #1c0d05;
  border-color: #c9925a;
}

.fruit-desktop__contact-spacer {
  width: 1.1em;
  flex-shrink: 0;
  display: inline-block;
}
