@font-face {
  font-family: "Fredoka One";
  src: url("FredokaOne.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #2b2f4a;
  --ink: #ffffff;
  --ink-soft: rgba(255, 255, 255, 0.78);
  --panel: rgba(28, 31, 52, 0.86);
  --line: rgba(255, 255, 255, 0.16);
  --accent: #ffc93c;
  --accent-ink: #2b2140;
  --accent-shadow: #d9921a;
  --secondary: rgba(255, 255, 255, 0.14);
  --star-off: rgba(255, 255, 255, 0.22);
  --radius: 18px;
  --display: "Fredoka One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
}

[hidden] { display: none !important; }

#unity-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: var(--bg);
  outline: none;
  touch-action: none;
}

.screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.poster {
  background: linear-gradient(rgba(30, 33, 58, 0.55), rgba(30, 33, 58, 0.85)), url("poster.jpg") center / cover no-repeat, var(--bg);
}

.dim { background: rgba(20, 22, 40, 0.62); }

.panel {
  width: 100%;
  max-width: 440px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  text-align: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.panel.narrow { max-width: 360px; }

.app-icon {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

h1, h2 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.5px;
  margin: 12px 0 6px;
}

h1 { font-size: 34px; }
h2 { font-size: 28px; }

p { margin: 0 0 12px; line-height: 1.4; color: var(--ink-soft); }

.tag { font-size: 16px; }

.hint { font-size: 13px; color: var(--ink-soft); margin: 10px 0 0; }

.progress {
  height: 12px;
  margin: 18px 0 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

#progress-fill {
  width: 0;
  height: 100%;
  border-radius: 6px;
  background: var(--accent);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 14px;
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: 0.4px;
  text-decoration: none;
  cursor: pointer;
  color: var(--ink);
  background: var(--secondary);
  transition: transform 0.08s ease-out, filter 0.15s;
}

.button:active { transform: translateY(2px); }

.button.primary {
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 4px 0 var(--accent-shadow);
}

.button.primary:active { box-shadow: 0 2px 0 var(--accent-shadow); }

.button.big {
  width: 100%;
  min-height: 56px;
  margin-top: 18px;
  font-size: 22px;
}

#play-button { animation: pulse 1.6s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}

.text-link {
  display: inline-block;
  margin-top: 14px;
  padding: 4px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.legal {
  position: absolute;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-soft);
}

.legal a, .legal .text-link { margin: 0; font-size: 12px; color: var(--ink-soft); }

.row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
}

.row .button { flex: 1 1 0; }

.stars { font-size: 40px; line-height: 1; letter-spacing: 6px; }
.stars .on { color: var(--accent); text-shadow: 0 3px 0 var(--accent-shadow); }
.stars .off { color: var(--star-off); }

.rotate-icon {
  width: 46px;
  height: 76px;
  margin: 4px auto 0;
  border: 4px solid var(--ink);
  border-radius: 10px;
  animation: rotate-phone 1.8s ease-in-out infinite;
}

@keyframes rotate-phone {
  0%, 25% { transform: rotate(0deg); }
  60%, 100% { transform: rotate(-90deg); }
}

.consent {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 560px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #1c1f34;
  border: 1px solid var(--line);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
  font-size: 13px;
}

.consent p { margin: 0; color: var(--ink-soft); }
.consent strong { color: var(--ink); margin-right: 4px; }
.consent a { color: var(--ink); }
.consent .row { margin-top: 10px; }
.consent .button { min-height: 40px; font-size: 15px; }

/* landscape phones: about 360-430 px tall, so lay panels out side by side */
@media (orientation: landscape) and (max-height: 520px) {
  .panel { max-width: 720px; padding: 16px 20px; }

  #loader .panel {
    display: flex;
    align-items: center;
    gap: 22px;
    text-align: left;
  }

  #loader .app-icon { width: 104px; height: 104px; flex: none; }
  #loader .intro { flex: 1; }

  h1 { font-size: 28px; margin-top: 0; }
  h2 { font-size: 24px; margin: 4px 0; }
  .tag { font-size: 14px; margin-bottom: 0; }
  .button.big { min-height: 50px; margin-top: 12px; font-size: 20px; }
  .text-link { margin-top: 8px; }

  .panel.end {
    display: flex;
    align-items: center;
    gap: 24px;
  }

  .panel.end .result, .panel.end .actions { flex: 1 1 0; }
  .panel.end .button.big { margin-top: 0; }
  .stars { font-size: 34px; }

  .consent { max-width: 680px; display: flex; gap: 14px; align-items: center; }

  /* keep the loader clear of the banner */
  body.consent-open #loader { justify-content: flex-start; }
  body.consent-open #loader .legal { display: none; }
  .consent .row { margin-top: 0; flex: none; }
}
