*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-tap-highlight-color: transparent;
  height: 100%;
  height: -webkit-fill-available;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  font-family:
    "PingFang SC",
    "Helvetica Neue",
    "Microsoft YaHei",
    system-ui,
    -apple-system,
    sans-serif;
  background: linear-gradient(165deg, #1a1a2e 0%, #16213e 45%, #0f3460 100%);
  color: #eee;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

body.gate-open {
  overflow: hidden;
}

.user-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  padding-top: calc(20px + env(safe-area-inset-top, 0px));
  background: rgba(10, 12, 28, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.user-gate.hidden {
  display: none;
}

.user-gate-card {
  width: 100%;
  max-width: 360px;
  padding: 22px 20px 24px;
  border-radius: 16px;
  background: linear-gradient(180deg, #252542 0%, #1e1e36 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.user-gate-card h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  text-align: center;
}

.user-gate-tip {
  margin: 0 0 16px;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.65);
  text-align: center;
}

.gate-input {
  margin-bottom: 4px;
}

.gate-err {
  min-height: 1.25em;
  margin: 8px 0 12px;
  font-size: 0.8125rem;
  color: #ff8a8a;
  text-align: center;
}

.gate-submit {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a2e;
  background: linear-gradient(145deg, #ffd93d, #f5c400);
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 4px 16px rgba(255, 217, 61, 0.35);
}

.gate-submit:active {
  transform: scale(0.98);
}

.page {
  max-width: 440px;
  margin: 0 auto;
  padding: 0 16px calc(32px + env(safe-area-inset-bottom, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.ticker-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -16px 12px;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 44px;
}

.ticker-label {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: #ffd93d;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.ticker-viewport {
  flex: 1;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.ticker-track {
  display: flex;
  width: max-content;
  animation-name: ticker-scroll;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform;
}

.ticker-track.paused {
  animation-play-state: paused;
}

.ticker-seg {
  white-space: nowrap;
  padding-right: 4rem;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.88);
}

@keyframes ticker-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.header {
  text-align: center;
  margin-bottom: 12px;
}

.header h1 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.sub {
  margin: 0;
  font-size: 0.8125rem;
  opacity: 0.78;
  line-height: 1.45;
}

.card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.activity-body {
  margin-top: 4px;
}

.activity-content {
  font-size: 0.875rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.9);
}

.activity-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.wheel-wrap {
  position: relative;
  width: min(88vw, 300px);
  height: min(88vw, 300px);
  margin: 8px auto 16px;
  align-self: center;
}

#wheel {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.45),
    inset 0 0 0 6px rgba(255, 255, 255, 0.08);
}

.pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 22px solid #ffd93d;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
  z-index: 2;
}

.spin-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, #ff6b6b, #ee5a5a);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  z-index: 3;
  box-shadow:
    0 4px 16px rgba(238, 90, 90, 0.55),
    inset 0 -2px 0 rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.spin-btn:active:not(:disabled) {
  transform: translate(-50%, -50%) scale(0.96);
  filter: brightness(0.95);
}

.spin-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.banner {
  text-align: center;
  font-size: 0.875rem;
  color: #ffb4b4;
  margin: 0 0 8px;
  padding: 8px 12px;
  background: rgba(231, 76, 60, 0.2);
  border-radius: 10px;
  border: 1px solid rgba(231, 76, 60, 0.35);
}

.result {
  min-height: 1.4em;
  text-align: center;
  font-size: 1rem;
  margin: 0 0 6px;
}

.result.win {
  color: #ffd93d;
  font-weight: 600;
}

.field-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.92);
}

.cdk-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 16px;
  letter-spacing: 0.06em;
}

.cdk-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.cdk-input:focus {
  outline: none;
  border-color: #ffd93d;
  box-shadow: 0 0 0 2px rgba(255, 217, 61, 0.25);
}

.field-hint {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.4;
}

.rules-title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffd93d;
}

.rules-text {
  font-size: 0.8125rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.82);
  white-space: pre-wrap;
  word-break: break-word;
}

.footer {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.footer a {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.75rem;
  text-decoration: none;
}

.footer a:hover {
  color: rgba(255, 255, 255, 0.75);
}

.link-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  touch-action: manipulation;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-btn:hover {
  color: rgba(255, 255, 255, 0.75);
}

.footer-sep {
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.75rem;
}
