/* SoloBet Spin — modern navy / yellow (aligned with landing) */

@font-face {
  font-family: "Gilroy";
  src: url("fonts/Gilroy-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gilroy";
  src: url("fonts/Gilroy-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gilroy";
  src: url("fonts/Gilroy-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gilroy";
  src: url("fonts/Gilroy-Heavy.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-deep: #0a1219;
  --bg: #10212e;
  --bg-panel: #152937;
  --bg-surface: #1a3040;
  --cream: #f4f6f8;
  --brass: #d4c41a;
  --brass-bright: #f7e522;
  --accent: #ff8a1f;
  --chrome: #9aadb8;
  --chrome-lit: #e4eaee;
  --ink: #10212e;
  --muted: #9aadb8;
  --border: rgba(255, 255, 255, 0.08);
  --border-yellow: rgba(247, 229, 34, 0.35);
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  --shadow-cta: 0 8px 24px rgba(247, 229, 34, 0.28);
  --radius-md: 12px;
  --radius-lg: 18px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

body {
  font-family: "Gilroy", "Outfit", "Segoe UI", sans-serif;
  color: var(--cream);
  background: var(--bg-deep);
  overflow: hidden;
  /* Brand + copy + chrome around the video window */
  --fit-chrome: 16.75rem;
}

body.is-won {
  --fit-chrome: 20.25rem;
}

body.tg-miniapp {
  --fit-chrome: 17.5rem;
}

body.tg-miniapp.is-won {
  --fit-chrome: 21rem;
}

body.tg-miniapp .stage {
  padding-top: max(0.45rem, env(safe-area-inset-top));
  padding-bottom: max(0.55rem, env(safe-area-inset-bottom));
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 85% 48% at 50% -8%, rgba(247, 229, 34, 0.1), transparent 58%),
    radial-gradient(ellipse 70% 40% at 80% 20%, rgba(255, 138, 31, 0.06), transparent 50%),
    radial-gradient(ellipse 90% 55% at 50% 105%, rgba(16, 33, 46, 0.95), transparent 55%),
    linear-gradient(165deg, #0a1219 0%, #10212e 42%, #0c1822 100%);
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

.stage {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 auto;
  padding: max(0.5rem, env(safe-area-inset-top)) 0.85rem max(0.5rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow: hidden;
}

.brand {
  margin: 0;
  line-height: 0;
  flex-shrink: 0;
  animation: brandIn 0.7s var(--ease-out) both;
}

.brand-logo {
  display: block;
  width: clamp(2.5rem, 11vw, 3.35rem);
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 2px 12px rgba(247, 229, 34, 0.28));
}

.headline {
  margin: 0.25rem 0 0;
  font-family: "Gilroy", "Outfit", "Segoe UI", sans-serif;
  font-size: clamp(1.2rem, 4.6vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--cream);
  flex-shrink: 0;
  animation: rise 0.7s 0.08s var(--ease-out) both;
}

.sub {
  margin: 0.15rem 0 0;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.01em;
  flex-shrink: 0;
  animation: rise 0.7s 0.14s var(--ease-out) both;
}

.cabinet {
  width: 100%;
  margin-top: 0.45rem;
  position: relative;
  overflow: visible;
  flex: 0 0 auto;
  animation: rise 0.85s 0.18s var(--ease-out) both;
}

.cabinet-body {
  position: relative;
  padding: 0.55rem 0.65rem 0.6rem;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.06), transparent 40%),
    linear-gradient(180deg, #152937 0%, #10212e 48%, #0c1822 100%);
  border: 1px solid var(--border-yellow);
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.cabinet-body::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(247, 229, 34, 0.08);
}

.marquee {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
  padding: 0 0.15rem;
}

.lamp {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
}

.lamp::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brass-bright), var(--accent));
  opacity: 0.28;
}

body.is-playing .lamp::after {
  animation: lampRun 0.4s linear infinite;
}

body.is-won .lamp::after {
  opacity: 0.95;
  animation: lampWin 0.55s ease-in-out infinite alternate;
}

.display {
  margin-bottom: 0.45rem;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(10, 18, 25, 0.95), rgba(16, 33, 46, 0.9));
  border: 1px solid rgba(247, 229, 34, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 0 24px rgba(0, 0, 0, 0.35);
}

.display-label {
  margin: 0;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.display-value {
  margin: 0;
  font-family: "Gilroy", "Outfit", "Segoe UI", sans-serif;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--brass-bright);
  text-shadow: 0 0 18px rgba(247, 229, 34, 0.25);
}

.display-value.is-win {
  color: var(--brass-bright);
  text-shadow: 0 0 20px rgba(247, 229, 34, 0.4);
  animation: pop 0.4s var(--ease-out) both;
}

/* —— Video window (crop/transform geometry MUST stay intact) —— */
.window {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-deep);
  border: 1px solid rgba(247, 229, 34, 0.28);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.55),
    inset 0 10px 24px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.03);
  aspect-ratio: 9 / 12;
  /* Shrink so ÇEVİR stays on-screen; width follows aspect ratio */
  width: min(100%, calc((100dvh - var(--fit-chrome)) * 9 / 12));
  max-height: calc(100dvh - var(--fit-chrome));
  margin-inline: auto;
}

/* Videodaki üst/alt beyaz şeritleri kapat */
.window::before,
.window::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 22px;
  z-index: 5;
  background: var(--bg-deep);
  pointer-events: none;
}

.window::before { top: 0; }
.window::after { bottom: 0; }

.slot-video {
  position: absolute;
  top: 50%;
  left: 0;
  display: block;
  width: 112%;
  height: 118%;
  max-width: none;
  object-fit: cover;
  object-position: 38% 50%;
  /* Yatay hizayı koru; dikeyde büyütüp beyaz kenarı kırp */
  transform: translate(calc(6% - 40px), -50%);
  background: var(--bg-deep);
  pointer-events: none;
}

.glass {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.07), transparent 30%, transparent 70%, rgba(255, 255, 255, 0.03));
}

.missing-video {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  place-items: center;
  padding: 1.25rem;
  background: var(--bg-deep);
  color: var(--cream);
  font-size: 0.85rem;
  line-height: 1.45;
}

.missing-video.is-on {
  display: grid;
}

.missing-video code {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.15rem 0.4rem;
  border-radius: 0.3rem;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
}

/*
  Videoda zaten kol var. Sahte HTML kol çerçeveye biniyordu —
  sadece sağda görünmez tıklama alanı bırakıyoruz.
*/
.lever-hit {
  position: absolute;
  right: 0;
  top: 28%;
  z-index: 12;
  width: 22%;
  height: 55%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.lever-hit:disabled {
  cursor: default;
}

.lever-arm,
.lever-knob {
  display: none;
}

.lever-hit:focus-visible {
  outline: 2px solid var(--brass-bright);
  outline-offset: -4px;
  border-radius: 0.75rem;
}

.cabinet-base {
  margin-top: 0.35rem;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(247, 229, 34, 0.45), var(--accent), rgba(247, 229, 34, 0.45), transparent);
  opacity: 0.85;
}

.win-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: none;
  place-items: center;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(10, 18, 25, 0.2), rgba(10, 18, 25, 0.72) 55%, rgba(10, 18, 25, 0.9));
}

.win-overlay.is-on {
  display: grid;
  animation: winIn 0.4s var(--ease-out) both;
}

.win-card {
  width: min(100%, 16rem);
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.06), transparent 45%),
    linear-gradient(180deg, rgba(26, 48, 64, 0.96), rgba(10, 18, 25, 0.97));
  border: 1px solid var(--border-yellow);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  justify-self: center;
  margin-left: 12px; /* net sağa — transform/animasyon ezmez */
}

.win-card p {
  margin: 0;
}

.win-card .win-kicker {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.win-card .win-amount {
  margin-top: 0.4rem;
  font-family: "Gilroy", "Outfit", "Segoe UI", sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--brass-bright);
  text-shadow: 0 0 20px rgba(247, 229, 34, 0.3);
}

.win-card .win-code-label {
  margin-top: 0.9rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.win-card .win-code {
  margin-top: 0.4rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  font-family: "Gilroy", "Outfit", monospace, sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--brass-bright);
  border: 1px solid rgba(255, 255, 255, 0.15);
  word-break: break-all;
  user-select: all;
}

.btn-copy {
  appearance: none;
  margin-top: 0.7rem;
  width: 100%;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--cream);
  background: transparent;
  cursor: pointer;
  transition: border-color 0.18s var(--ease-out), color 0.18s var(--ease-out), background 0.18s var(--ease-out);
}

.btn-copy:hover {
  border-color: var(--brass-bright);
  color: var(--brass-bright);
}

.btn-copy:active {
  transform: scale(0.98);
}

.btn-copy.is-copied {
  color: var(--ink);
  background: var(--brass-bright);
  border-color: transparent;
}

.result {
  margin: 0.4rem 0 0;
  font-family: "Gilroy", "Outfit", "Segoe UI", sans-serif;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--brass-bright);
  flex-shrink: 0;
  line-height: 1.25;
}

.result.is-on {
  animation: pop 0.45s cubic-bezier(0.2, 1.2, 0.3, 1) both;
}

.actions {
  width: 100%;
  margin-top: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex-shrink: 0;
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  padding: 0.85rem 1.1rem;
  min-height: 48px;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s var(--ease-out), filter 0.18s var(--ease-out), opacity 0.2s ease, background 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn:focus-visible {
  outline: 2px solid var(--brass-bright);
  outline-offset: 3px;
}

.btn-spin {
  color: #000;
  background: #f2e500;
  box-shadow: var(--shadow-cta);
}

.btn-spin:hover:not(:disabled) {
  background: #ffe84a;
  transform: translateY(-2px);
}

.btn-spin:active:not(:disabled) {
  transform: translateY(0);
}

.btn-spin.is-pulse {
  animation: pulse 1.35s ease-in-out infinite;
}

.btn-claim {
  display: none;
  color: var(--cream);
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  box-shadow: none;
}

.btn-claim:hover {
  border-color: var(--brass-bright);
  color: var(--brass-bright);
}

.btn-claim.is-on {
  display: flex;
  animation: rise 0.45s var(--ease-out) both;
}

.legal {
  margin-top: 0.4rem;
  padding-top: 0;
  font-size: 0.58rem;
  line-height: 1.35;
  color: var(--muted);
  opacity: 0.75;
  max-width: 38ch;
  flex-shrink: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

@media (max-height: 720px) {
  .sub {
    display: none;
  }

  body {
    --fit-chrome: 14.75rem;
  }

  body.is-won {
    --fit-chrome: 18.25rem;
  }
}

@media (max-height: 640px) {
  .marquee {
    display: none;
  }

  .legal {
    display: none;
  }

  body {
    --fit-chrome: 12.75rem;
  }

  body.is-won {
    --fit-chrome: 16.5rem;
  }
}

.fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  overflow: hidden;
}

.coin {
  position: absolute;
  top: -2rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffe84a, #f7e522 55%, #ff8a1f);
  animation: coinFall linear forwards;
}

body.is-won .cabinet-body {
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(247, 229, 34, 0.4),
    0 0 40px rgba(247, 229, 34, 0.18);
}

@keyframes brandIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes winIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pop {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { filter: brightness(1); opacity: 1; }
  50% { filter: brightness(1.08); opacity: 0.9; }
}

@keyframes lampRun {
  0%, 100% { opacity: 0.28; }
  50% { opacity: 0.95; }
}

@keyframes lampWin {
  from { opacity: 0.55; }
  to { opacity: 1; filter: brightness(1.15); }
}

@keyframes coinFall {
  to {
    transform: translateY(110vh) rotate(540deg);
    opacity: 0.2;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
