:root {
  --bg: #0b0c0e;
  --elev: #14161a;
  --ink: #f4f1ea;
  --muted: #c9c2b6;
  --line: rgba(255, 255, 255, 0.1);
  --orange: #e88c4a;
  --ok: #7dcea0;
  --danger: #e07a7a;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: "IBM Plex Sans", system-ui, sans-serif; }
a { color: var(--orange); text-decoration: none; }
.wrap { max-width: 880px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2.5rem; }
.brand img { display: block; height: 42px; width: auto; }
.hero h1 { font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 0.75rem; }
.hero p { color: var(--muted); max-width: 38rem; line-height: 1.55; }
.cards { display: grid; gap: 1rem; margin: 2rem 0; }
.card { background: var(--elev); border: 1px solid var(--line); border-radius: 16px; padding: 1.15rem 1.25rem; }
.card h2 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); line-height: 1.5; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 1.1rem; border-radius: 999px; border: 0; background: var(--orange); color: #1a1008; font-weight: 600; cursor: pointer; }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn--sm { padding: 0.55rem 0.75rem; font-size: 0.92rem; }
.pad { min-height: 100dvh; display: flex; flex-direction: column; padding: max(12px, 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)); }
.pad__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.chip { font-size: 13px; padding: 0.35rem 0.7rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.chip.is-ok { color: var(--ok); border-color: rgba(125, 206, 160, 0.4); }
.chip.is-bad { color: var(--danger); border-color: rgba(224, 122, 122, 0.4); }
.pad__stage { flex: 1; display: grid; place-items: center; gap: 16px; }
.hit { width: min(42vh, 220px); height: min(42vh, 220px); min-width: 56px; min-height: 56px; border-radius: 50%; border: 0; background: radial-gradient(circle at 35% 30%, #ffb087, var(--orange) 55%, #b85a22); color: #1a1008; font-size: 1.35rem; font-weight: 700; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.hit:active { transform: scale(0.97); }
.dino { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 720px; }
.dino .hit { width: 100%; height: min(38vh, 200px); border-radius: 28px; }
.ended { text-align: center; max-width: 22rem; }
.ended h1 { font-family: "Cormorant Garamond", Georgia, serif; font-size: 2rem; margin: 0 0 0.6rem; }
.ended p { color: var(--muted); }
.orient { display: none; position: fixed; inset: 0; z-index: 20; background: rgba(11, 12, 14, 0.96); align-items: center; justify-content: center; text-align: center; padding: 2rem; }
.orient.is-on { display: flex; }
.orient p { color: var(--muted); max-width: 18rem; }
@media (orientation: portrait) {
  .pad.is-live:not(.is-register) .orient { display: flex; }
  .pad.is-live:not(.is-register) .pad__stage { filter: grayscale(0.4); pointer-events: none; opacity: 0.25; }
}

.pad.is-register .orient { display: none !important; }
.pad.is-register .pad__stage {
  filter: none;
  pointer-events: auto;
  opacity: 1;
  align-items: stretch;
  place-items: stretch;
  padding: 0.5rem 0 1rem;
}

.gate {
  width: min(100%, 420px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.25rem 0 1rem;
}
.gate__head h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.85rem, 7vw, 2.4rem);
  margin: 0 0 0.35rem;
}
.gate__head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.gate__timer {
  position: relative;
  margin-top: 1rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gate__timer span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  background: linear-gradient(90deg, rgba(232, 140, 74, 0.35), rgba(232, 140, 74, 0.12));
  transition: width 0.2s linear;
}
.gate__timer strong {
  position: relative;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.gate__field {
  display: grid;
  gap: 0.35rem;
}
.gate__field span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.gate__field input {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0b0c0e;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
.gate__field input:focus {
  outline: none;
  border-color: rgba(232, 140, 74, 0.55);
}
.gate__err {
  margin: 0;
  color: var(--danger);
  font-size: 0.88rem;
}
.gate__submit {
  width: 100%;
  margin-top: 0.35rem;
}

.pad.is-selfie .orient { display: none !important; }
.pad.is-selfie .pad__stage {
  filter: none;
  pointer-events: auto;
  opacity: 1;
  align-items: stretch;
  place-items: stretch;
  padding: 0.5rem 0 1rem;
}

.selfie {
  width: min(100%, 460px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.25rem 0 1rem;
}
.selfie__head h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.85rem, 7vw, 2.4rem);
  margin: 0 0 0.35rem;
}
.selfie__head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.selfie__view {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  overflow: hidden;
  background: #050607;
  border: 1px solid var(--line);
}
.selfie__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}
.selfie__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: grid;
  place-items: center;
}
.selfie__oval {
  width: min(72%, 260px);
  aspect-ratio: 3 / 4;
  border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(11, 12, 14, 0.62);
  border: 2px solid rgba(244, 241, 234, 0.55);
}
.selfie__guide {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.85rem;
  margin: 0;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.75);
  pointer-events: none;
}
.selfie__board {
  width: 100%;
  min-height: min(58vh, 360px);
  aspect-ratio: 1;
  border-radius: 16px;
  border: 1px solid var(--line);
  overflow: hidden;
  display: grid;
  place-items: center;
  background-color: #1a1c20;
  background-image:
    linear-gradient(45deg, #2a2d33 25%, transparent 25%),
    linear-gradient(-45deg, #2a2d33 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2a2d33 75%),
    linear-gradient(-45deg, transparent 75%, #2a2d33 75%);
  background-size: 28px 28px;
  background-position: 0 0, 0 14px, 14px -14px, -14px 0;
}
.selfie__result {
  width: min(92%, 340px);
  height: auto;
  max-height: 92%;
  object-fit: contain;
  image-rendering: auto;
}
.selfie__tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.selfie__tools .btn {
  width: 100%;
}
.selfie__err {
  margin: 0;
  color: var(--danger);
  font-size: 0.88rem;
}
.selfie__actions {
  display: grid;
  gap: 0.55rem;
}
.selfie__actions .btn {
  width: 100%;
}
