:root {
  --n9-bg: #060503;
  --n9-panel: #17130b;
  --n9-panel-deep: #0d0b07;
  --n9-gold-border: #a5854a;
  --n9-gold: #d4af6a;
  --n9-gold-light: #f0d48a;
  --n9-copy: #f3e7c8;
  --n9-line: #06c755;
  --n9-font-display: "Cinzel", Georgia, serif;
  --n9-font-heading: "Shippori Mincho", "Yu Mincho", serif;
  --n9-font-ui: "Noto Sans JP", system-ui, -apple-system, sans-serif;
  --n9-page-padding-block: 24px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--n9-bg);
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--n9-bg);
  color: var(--n9-copy);
  font-family: var(--n9-font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--n9-gold-light);
  outline-offset: 3px;
}

.n9-app {
  position: relative;
  isolation: isolate;
  width: min(100%, 440px);
  min-height: 100vh;
  min-height: 100dvh;
  margin-inline: auto;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #1c1810 0%, #0c0a06 55%, #060503 100%);
  color: var(--n9-copy);
  font-family: var(--n9-font-ui);
  user-select: none;
}

.n9-app a {
  color: inherit;
}

.n9-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.n9-fade-up {
  animation: n9-fade-up 0.5s ease both;
}

.n9-page-message {
  position: fixed;
  z-index: 55;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  width: min(calc(100% - 32px), 408px);
  padding: 11px 14px;
  border: 1px solid rgb(212 175 106 / 42%);
  border-radius: 12px;
  background: rgb(23 19 11 / 94%);
  box-shadow: 0 10px 30px rgb(0 0 0 / 45%);
  color: rgb(243 231 200 / 82%);
  font-size: 11.5px;
  line-height: 1.6;
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.n9-page-message--alert {
  border-color: rgb(201 79 79 / 55%);
  color: #f2c3b8;
}

.n9-delay-1 { animation-delay: 0.08s; }
.n9-delay-2 { animation-delay: 0.12s; }
.n9-delay-3 { animation-delay: 0.25s; }
.n9-delay-4 { animation-delay: 0.35s; }

@keyframes n9-spin {
  to { transform: rotate(360deg); }
}

@keyframes n9-twinkle {
  0%, 100% { opacity: 0.1; transform: scale(0.6) rotate(45deg); }
  50% { opacity: 0.9; transform: scale(1.1) rotate(45deg); }
}

@keyframes n9-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@keyframes n9-pop-in {
  0% { opacity: 0; transform: scale(0.4); }
  70% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes n9-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes n9-stripe-move {
  to { transform: translateX(51px); }
}

@keyframes n9-flash {
  from { opacity: 0.9; }
  to { opacity: 0; }
}

.n9-crown {
  display: block;
  overflow: visible;
}

.n9-crown path {
  fill: none;
  stroke: var(--n9-gold);
  stroke-linejoin: round;
}

.n9-crown circle {
  fill: var(--n9-gold);
}

.n9-crown--large {
  width: 44px;
  height: 28px;
  margin-bottom: 2px;
}

.n9-crown--large path { stroke-width: 2; }
.n9-crown--medium { width: 30px; height: 19px; }
.n9-crown--medium path { stroke-width: 2.4; }
.n9-crown--small { width: 22px; height: 13px; }
.n9-crown--small path { stroke-width: 3; }

.n9-diamond-rule {
  display: flex;
  width: 82%;
  align-items: center;
  gap: 10px;
  margin: 14px 0 12px;
}

.n9-diamond-rule span {
  flex: 1;
  height: 1px;
  background: var(--n9-gold-border);
}

.n9-diamond-rule i {
  width: 6px;
  height: 6px;
  background: var(--n9-gold);
  transform: rotate(45deg);
}

/* Login */

.n9-login__panel {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  align-items: center;
  padding: calc(env(safe-area-inset-top) + var(--n9-page-padding-block)) 26px calc(env(safe-area-inset-bottom) + var(--n9-page-padding-block));
  overflow-y: auto;
}

.n9-eyebrow-rule {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
}

.n9-eyebrow-rule span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--n9-gold-border));
}

.n9-eyebrow-rule span:last-child {
  background: linear-gradient(270deg, transparent, var(--n9-gold-border));
}

.n9-eyebrow-rule p {
  margin: 0;
  color: var(--n9-gold);
  font-family: var(--n9-font-display);
  font-size: 12px;
  letter-spacing: 4px;
  white-space: nowrap;
}

.n9-login__content {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding-block: 28px;
}

.n9-brand-card {
  padding: 5px;
  border: 1.5px solid var(--n9-gold-border);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgb(0 0 0 / 50%);
}

.n9-brand-card__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 34px 24px 30px;
  border: 1px solid rgb(212 175 106 / 45%);
  border-radius: 15px;
  background: linear-gradient(160deg, #17130b 0%, #0d0b07 70%);
}

.n9-brand-card__logo {
  width: 82px;
  height: 88px;
  margin-top: 8px;
  filter: drop-shadow(0 6px 16px rgb(212 175 106 / 35%));
}

.n9-brand-card__name {
  color: #e8d5a0;
  font-family: var(--n9-font-display);
  font-size: 19px;
  letter-spacing: 6px;
}

.n9-brand-card__tagline {
  margin-top: 6px;
  color: rgb(212 175 106 / 75%);
  font-family: var(--n9-font-display);
  font-size: 9px;
  letter-spacing: 3.5px;
}

.n9-login__copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 30px;
  text-align: center;
}

.n9-login__copy h1 {
  margin: 0;
  color: var(--n9-copy);
  font-family: var(--n9-font-heading);
  font-size: 18px;
  font-weight: 600;
}

.n9-login__copy p {
  margin: 0;
  color: rgb(230 215 180 / 60%);
  font-size: 12.5px;
  line-height: 1.9;
}

.n9-login__actions {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.n9-line-button {
  display: flex;
  width: 100%;
  height: 54px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 14px;
  background: var(--n9-line);
  box-shadow: 0 8px 24px rgb(6 199 85 / 35%);
  color: #fff !important;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  text-decoration: none;
  transition: filter 0.2s ease, transform 0.12s ease;
}

.n9-line-button:hover { filter: brightness(1.04); }
.n9-line-button:active { transform: scale(0.98); }
.n9-line-button svg { width: 24px; height: 24px; }

.n9-login__note {
  margin: 0;
  color: rgb(230 215 180 / 42%);
  font-size: 10.5px;
  letter-spacing: 0.5px;
}

.n9-development-login {
  min-height: 44px;
  margin-top: -4px;
  padding: 12px 16px;
  color: rgb(230 215 180 / 55%) !important;
  font-size: 11px;
  text-underline-offset: 3px;
}

.n9-twinkle {
  position: absolute;
  width: 5px;
  height: 5px;
  background: var(--n9-gold);
  transform: rotate(45deg);
  animation: n9-twinkle 3s ease-in-out infinite;
}

.n9-twinkle--one { top: 120px; left: 40px; width: 7px; height: 7px; background: var(--n9-gold-light); animation-duration: 2.6s; }
.n9-twinkle--two { top: 210px; right: 34px; animation-duration: 3.2s; animation-delay: 0.8s; }
.n9-twinkle--three { bottom: 220px; left: 52px; animation-duration: 2.9s; animation-delay: 1.4s; }
.n9-twinkle--four { right: 58px; bottom: 320px; width: 7px; height: 7px; background: var(--n9-gold-light); animation-duration: 3.5s; animation-delay: 0.4s; }

.n9-auth {
  display: flex;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.n9-auth__spinner {
  width: 46px;
  height: 46px;
  border: 3px solid rgb(212 175 106 / 18%);
  border-top-color: var(--n9-gold);
  border-radius: 50%;
  animation: n9-spin 0.9s linear infinite;
}

.n9-auth p {
  margin: 0;
  color: rgb(230 215 180 / 70%);
  font-size: 13px;
  letter-spacing: 2px;
}

/* Card list */

.n9-cards {
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top) + var(--n9-page-padding-block)) 22px calc(env(safe-area-inset-bottom) + var(--n9-page-padding-block));
  overflow-y: auto;
}

.n9-cards__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.n9-mini-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--n9-gold);
  font-family: var(--n9-font-display);
  font-size: 13px;
  letter-spacing: 3px;
  white-space: nowrap;
}

.n9-mini-brand__mark {
  display: flex;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--n9-gold-border);
  border-radius: 50%;
  background: #13100a;
}

.n9-mini-brand__mark img { width: 17px; height: 18px; }

.n9-user-menu {
  position: relative;
  min-width: 0;
}

.n9-user-menu > summary {
  list-style: none;
}

.n9-user-menu > summary::-webkit-details-marker {
  display: none;
}

.n9-user-summary {
  display: flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-left: 8px;
  color: rgb(230 215 180 / 70%);
  font-size: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.n9-user-summary > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.n9-avatar {
  display: flex;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--n9-line);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.n9-avatar img { width: 100%; height: 100%; object-fit: cover; }

.n9-user-summary__chevron {
  width: 10px;
  height: 6px;
  flex: 0 0 auto;
  transition: transform 0.18s ease;
}

.n9-user-summary__chevron path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.n9-user-menu[open] .n9-user-summary__chevron {
  transform: rotate(180deg);
}

.n9-user-menu__panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  width: 156px;
  padding: 7px;
  border: 1px solid rgb(212 175 106 / 42%);
  border-radius: 12px;
  background: rgb(13 11 7 / 98%);
  box-shadow: 0 12px 32px rgb(0 0 0 / 45%);
}

.n9-user-menu__panel form {
  margin: 0;
}

.n9-logout-button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--n9-copy);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: center;
  cursor: pointer;
}

.n9-logout-button:hover,
.n9-logout-button:focus-visible {
  background: rgb(212 175 106 / 12%);
  color: var(--n9-gold-light);
}

.n9-cards__title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
}

.n9-cards__title-row h1 {
  margin: 0;
  color: var(--n9-copy);
  font-family: var(--n9-font-heading);
  font-size: 23px;
  font-weight: 600;
}

.n9-count-badge {
  flex: 0 0 auto;
  padding: 4px 10px;
  border: 1px solid rgb(212 175 106 / 50%);
  border-radius: 999px;
  color: var(--n9-gold);
  font-size: 11.5px;
}

.n9-cards__intro {
  margin: 8px 0 0;
  color: rgb(230 215 180 / 55%);
  font-size: 12px;
  line-height: 1.7;
}

.n9-card-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 22px;
}

.n9-card-row {
  display: flex;
  min-height: 88px;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--n9-gold-border);
  border-radius: 16px;
  background: linear-gradient(120deg, #17130c 0%, #0d0b07 100%);
  box-shadow: 0 10px 26px rgb(0 0 0 / 35%);
  color: inherit;
  text-decoration: none;
  animation: n9-fade-up 0.5s ease calc((var(--n9-order, 0) * 60ms) + 160ms) both;
  transition: border-color 0.2s ease, opacity 0.2s ease, transform 0.12s ease;
}

.n9-card-row:hover { border-color: var(--n9-gold-light); }
.n9-card-row:active { transform: scale(0.985); }
.n9-card-row--opened { border-color: rgb(165 133 74 / 45%); opacity: 0.7; }
.n9-card-row--used { border-color: rgb(165 133 74 / 45%); opacity: 0.4; }
.n9-card-row:focus-visible { opacity: 1; }

.n9-card-row__brand {
  display: flex;
  width: 78px;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding-block: 16px;
  border-right: 1px dashed rgb(212 175 106 / 35%);
}

.n9-card-row__brand img { width: 23px; height: 25px; }

.n9-card-row__details {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 14px 12px 14px 16px;
}

.n9-card-row__number {
  overflow: hidden;
  color: rgb(212 175 106 / 80%);
  font-family: var(--n9-font-display);
  font-size: 10px;
  letter-spacing: 2.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.n9-card-row__details strong {
  overflow: hidden;
  color: var(--n9-copy);
  font-size: 13.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.n9-card-row__details small {
  overflow: hidden;
  color: rgb(230 215 180 / 45%);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.n9-card-row__action {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding-right: 16px;
}

.n9-card-row__action > svg {
  width: 7px;
  height: 12px;
}

.n9-card-row__action > svg path {
  fill: none;
  stroke: rgb(212 175 106 / 60%);
  stroke-linecap: round;
  stroke-width: 1.5;
}

.n9-rank-badge {
  display: flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--n9-gold-border);
  border-radius: 50%;
  color: var(--n9-gold);
  font-family: var(--n9-font-heading);
  font-size: 14px;
  font-weight: 700;
}

.n9-scratch-pill {
  padding: 9px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #e9cf8e, #c19a4f);
  box-shadow: 0 4px 14px rgb(212 175 106 / 30%);
  color: #241a08;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 1px;
}

.n9-cards__expiry {
  margin: auto 0 0;
  padding-top: 24px;
  color: rgb(230 215 180 / 40%);
  font-size: 10.5px;
  letter-spacing: 0.5px;
  text-align: center;
}

.n9-empty-state {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 300px;
  color: rgb(230 215 180 / 48%);
  font-size: 13px;
  line-height: 1.9;
  text-align: center;
}

.n9-empty-state img { width: 50px; height: auto; opacity: 0.48; }
.n9-empty-state p { margin: 0; }

/* Scratch */

.n9-scratch {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(env(safe-area-inset-top) + var(--n9-page-padding-block)) 20px calc(env(safe-area-inset-bottom) + var(--n9-page-padding-block));
}

.n9-scratch__header {
  display: flex;
  width: 100%;
  align-items: center;
}

.n9-scratch__header > p {
  flex: 1;
  margin: 0;
  padding-right: 56px;
  color: var(--n9-gold);
  font-family: var(--n9-font-display);
  font-size: 11px;
  letter-spacing: 3.5px;
  text-align: center;
  white-space: nowrap;
}

.n9-back-link {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  color: rgb(212 175 106 / 85%) !important;
  font-size: 13px;
  text-decoration: none;
}

.n9-back-link svg { width: 8px; height: 14px; }
.n9-back-link path { fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.8; }

.n9-scratch__body {
  display: flex;
  width: 100%;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding-block: 20px;
}

.n9-scratch-card {
  width: min(358px, 100%);
  padding: 5px;
  border: 1.5px solid var(--n9-gold-border);
  border-radius: 18px;
  background: linear-gradient(150deg, #191509 0%, #0d0b06 60%, #12100a 100%);
  box-shadow: 0 14px 40px rgb(0 0 0 / 55%);
}

.n9-scratch-card.n9-is-winning {
  animation: n9-pop 0.7s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.n9-scratch-card__inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 12px;
  border: 1px solid rgb(212 175 106 / 45%);
  border-radius: 13px;
}

.n9-scratch-card__eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.n9-scratch-card__eyebrow span { flex: 1; height: 1px; background: var(--n9-gold-border); }
.n9-scratch-card__eyebrow p { margin: 0; color: var(--n9-gold); font-family: var(--n9-font-display); font-size: 9.5px; letter-spacing: 3px; white-space: nowrap; }

.n9-scratch-card__content {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 6px 14px;
  align-items: stretch;
}

.n9-scratch-card__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.n9-scratch-card__brand > img {
  width: 48px;
  height: 51px;
  margin-top: 3px;
  filter: drop-shadow(0 3px 9px rgb(212 175 106 / 30%));
}

.n9-diamond-rule--compact { width: 70%; gap: 5px; margin: 6px 0 5px; }
.n9-diamond-rule--compact i { width: 4px; height: 4px; }

.n9-scratch-card__brand strong {
  color: #e8d5a0;
  font-family: var(--n9-font-display);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 2.5px;
  white-space: nowrap;
}

.n9-scratch-card__brand small {
  margin-top: 3px;
  color: rgb(212 175 106 / 70%);
  font-family: var(--n9-font-display);
  font-size: 6.5px;
  letter-spacing: 1.8px;
  white-space: nowrap;
}

.n9-scratch-card__reveal-area {
  position: relative;
  height: 138px;
  overflow: hidden;
  border: 1.5px solid var(--n9-gold-border);
  border-radius: 14px;
  background: #0a0805;
}

.n9-prize-underlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
}

.n9-prize-underlay > p {
  margin: 0;
  color: rgb(230 215 180 / 85%);
  font-size: 11px;
  letter-spacing: 1px;
  line-height: 1.5;
  text-align: center;
}

.n9-diamond-rule--prize { width: 60%; gap: 6px; margin: 0; }
.n9-diamond-rule--prize span { background: rgb(212 175 106 / 50%); }
.n9-diamond-rule--prize i { width: 4px; height: 4px; }

.n9-prize-rank {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.n9-prize-rank strong {
  background: linear-gradient(180deg, #f8e7ab, #d4af6a 60%, #9a7b3f);
  background-clip: text;
  color: transparent;
  font-family: var(--n9-font-display);
  font-size: 46px;
  font-weight: 700;
  line-height: 1;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.n9-prize-rank span {
  color: #e8d5a0;
  font-family: var(--n9-font-heading);
  font-size: 24px;
  font-weight: 700;
}

.n9-foil-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  cursor: crosshair;
  touch-action: none;
  transition: opacity 0.6s ease;
}

.n9-foil-canvas.n9-is-revealed { opacity: 0; pointer-events: none; }
.n9-foil-canvas.n9-is-busy { cursor: wait; }

.n9-scratch-card__expiry {
  grid-column: 2;
  margin: 0;
  color: rgb(230 215 180 / 50%);
  font-size: 8.5px;
  text-align: center;
}

.n9-scratch-card__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 2px;
  color: rgb(212 175 106 / 75%);
}

.n9-scratch-card__footer svg { width: 14px; height: 16px; }
.n9-scratch-card__footer path { fill: none; stroke: var(--n9-gold-border); stroke-width: 2.5; }
.n9-scratch-card__footer span { font-family: var(--n9-font-display); font-size: 8px; letter-spacing: 2.2px; }

.n9-scratch-progress {
  display: flex;
  width: 240px;
  max-width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.n9-scratch-progress h1 {
  margin: 0;
  color: var(--n9-copy);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 1px;
  text-align: center;
}

.n9-progress-track {
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: rgb(212 175 106 / 15%);
}

.n9-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--n9-gold-border), var(--n9-gold-light));
  transition: width 0.25s ease;
}

.n9-scratch-progress > p {
  margin: 0;
  color: rgb(230 215 180 / 50%);
  font-size: 11px;
  letter-spacing: 1px;
}

.n9-keyboard-reveal {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.n9-keyboard-reveal:focus-visible {
  position: static;
  width: auto;
  height: 44px;
  padding: 0 16px;
  overflow: visible;
  border: 1px solid var(--n9-gold-border);
  border-radius: 12px;
  clip: auto;
  background: #17130b;
  color: var(--n9-copy);
  white-space: normal;
}

.n9-inline-error {
  width: min(310px, calc(100vw - 48px));
  padding: 12px;
  border: 1px solid rgb(212 175 106 / 40%);
  border-radius: 12px;
  background: rgb(23 19 11 / 92%);
  text-align: center;
}

.n9-inline-error p { margin: 0 0 8px; color: rgb(243 231 200 / 78%); font-size: 11px; line-height: 1.6; }
.n9-inline-error button { min-height: 36px; padding: 6px 14px; border: 0; background: transparent; color: var(--n9-gold-light); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.n9-winner-message {
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: n9-pop-in 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.n9-winner-message:not([hidden]) { display: flex; }
.n9-winner-message h2 { margin: 0; color: var(--n9-gold-light); font-family: var(--n9-font-heading); font-size: 22px; font-weight: 700; letter-spacing: 2px; text-shadow: 0 0 24px rgb(240 212 138 / 50%); }
.n9-winner-message p { margin: 0; color: rgb(230 215 180 / 60%); font-size: 11.5px; letter-spacing: 2px; }

.n9-noscript { margin: 0; color: #f0b7a8; font-size: 12px; text-align: center; }

.n9-flash,
.n9-confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.n9-flash { z-index: 46; background: #fff8e6; opacity: 0; }
.n9-flash.n9-is-active { animation: n9-flash 0.7s ease forwards; }
.n9-confetti { z-index: 44; }

/* Result */

.n9-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(env(safe-area-inset-top) + var(--n9-page-padding-block)) 26px calc(env(safe-area-inset-bottom) + var(--n9-page-padding-block));
  overflow-y: auto;
}

.n9-result__eyebrow {
  margin: 0;
  color: var(--n9-gold);
  font-family: var(--n9-font-display);
  font-size: 12px;
  letter-spacing: 5px;
}

.n9-result__title {
  margin: 10px 0 0;
  color: var(--n9-copy);
  font-family: var(--n9-font-heading);
  font-size: 25px;
  font-weight: 700;
}

.n9-medal-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 26px;
}

.n9-rank-medal {
  position: relative;
  display: flex;
  width: 158px;
  height: 158px;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--n9-gold-border);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 32%, #201a0e, #0c0a06 75%);
  box-shadow: 0 0 54px rgb(212 175 106 / 28%);
  animation: n9-pop-in 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) 0.1s both;
}

.n9-rank-medal__ring {
  position: absolute;
  inset: 6px;
  border: 1px solid rgb(212 175 106 / 45%);
  border-radius: 50%;
}

.n9-rank-medal strong {
  background: linear-gradient(180deg, #f8e7ab, #d4af6a 58%, #9a7b3f);
  background-clip: text;
  color: transparent;
  font-family: var(--n9-font-display);
  font-size: 62px;
  font-weight: 700;
  line-height: 1;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.n9-rank-medal > span:last-child {
  align-self: center;
  margin: 20px 0 0 3px;
  color: #e8d5a0;
  font-family: var(--n9-font-heading);
  font-size: 27px;
  font-weight: 700;
}

.n9-prize-panel {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 13px;
  margin-top: 26px;
  padding: 18px;
  border: 1px solid rgb(212 175 106 / 40%);
  border-radius: 18px;
  background: rgb(255 246 220 / 3%);
}

.n9-prize-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.n9-category {
  padding: 4px 10px;
  border-radius: 5px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}

.n9-category--chip { background: #8e1c1c; }
.n9-category--hotel { background: #1d3f8a; }

.n9-prize-panel__number {
  color: rgb(212 175 106 / 70%);
  font-family: var(--n9-font-display);
  font-size: 10px;
  letter-spacing: 2px;
}

.n9-prize-image {
  display: flex;
  width: 100%;
  height: 108px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
}

.n9-prize-image img { width: 100%; height: 100%; object-fit: cover; }

.n9-prize-image--placeholder {
  border: 1px dashed rgb(212 175 106 / 40%);
  background: repeating-linear-gradient(45deg, rgb(212 175 106 / 6%) 0 8px, transparent 8px 16px);
  color: rgb(212 175 106 / 60%);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 1px;
}

.n9-prize-panel h2 {
  margin: 0;
  color: #fff;
  font-family: var(--n9-font-heading);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.5;
}

.n9-prize-panel hr { width: 100%; height: 1px; margin: 0; border: 0; background: rgb(212 175 106 / 25%); }
.n9-prize-panel dl { display: flex; flex-direction: column; gap: 7px; margin: 0; font-size: 12px; }
.n9-prize-panel dl > div { display: flex; gap: 12px; }
.n9-prize-panel dt { flex: 0 0 auto; color: rgb(212 175 106 / 80%); }
.n9-prize-panel dd { margin: 0; color: rgb(230 215 180 / 75%); }

.n9-result__actions {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
  padding-top: 22px;
}

.n9-result__actions > section:first-child { width: 100%; }
.n9-result__actions > section:first-child > p { margin: 8px 0 0; color: rgb(230 215 180 / 45%); font-size: 10.5px; letter-spacing: 0.5px; text-align: center; }

.n9-gold-button,
.n9-outline-button,
.n9-cancel-button {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.2s ease, opacity 0.2s ease, transform 0.12s ease;
}

.n9-gold-button {
  height: 52px;
  border: 0;
  background: linear-gradient(180deg, #e9cf8e, #c19a4f);
  box-shadow: 0 8px 24px rgb(212 175 106 / 30%);
  color: #241a08;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
}

.n9-gold-button:hover { filter: brightness(1.04); }
.n9-gold-button:active:not(:disabled), .n9-outline-button:active { transform: scale(0.98); }
.n9-gold-button:disabled { cursor: wait; opacity: 0.62; }

.n9-outline-button {
  border: 1px solid rgb(212 175 106 / 55%);
  background: transparent;
  color: var(--n9-gold) !important;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 2px;
}

.n9-used-panel {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgb(230 215 180 / 25%);
  border-radius: 16px;
  background: #1a1712;
}

.n9-expired-panel {
  width: 100%;
  padding: 18px;
  border: 1px solid rgb(230 215 180 / 20%);
  border-radius: 16px;
  background: #15130f;
  color: rgb(230 215 180 / 55%);
  text-align: center;
}

.n9-expired-panel p,
.n9-expired-panel h2 { margin: 0; }
.n9-expired-panel p { font-family: var(--n9-font-display); font-size: 11px; letter-spacing: 4px; }
.n9-expired-panel h2 { margin-top: 5px; color: rgb(230 215 180 / 78%); font-family: var(--n9-font-heading); font-size: 22px; }
.n9-expired-panel span { display: block; margin-top: 5px; font-size: 11px; }

.n9-used-panel__stripes {
  position: absolute;
  inset: -60px;
  background: repeating-linear-gradient(-45deg, rgb(212 175 106 / 9%) 0 18px, transparent 18px 36px);
  animation: n9-stripe-move 2.4s linear infinite;
}

.n9-used-panel__content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 18px;
}

.n9-used-panel__content p { margin: 0; color: rgb(230 215 180 / 55%); font-size: 12px; }
.n9-used-panel__content .n9-used-panel__label { color: rgb(230 215 180 / 50%); font-family: var(--n9-font-display); font-size: 11px; letter-spacing: 4px; }
.n9-used-panel__content h2 { margin: 0; color: rgb(230 215 180 / 85%); font-family: var(--n9-font-heading); font-size: 25px; font-weight: 700; }
.n9-used-panel__content .n9-used-panel__clock { color: rgb(230 215 180 / 35%); font-size: 11px; font-variant-numeric: tabular-nums; }

.n9-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px;
}

.n9-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(4 3 2 / 74%);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.n9-modal__dialog {
  position: relative;
  display: flex;
  width: min(100%, 358px);
  flex-direction: column;
  gap: 14px;
  padding: 26px 22px 22px;
  border: 1.5px solid var(--n9-gold-border);
  border-radius: 20px;
  background: linear-gradient(160deg, #17130b, #0d0b07);
  box-shadow: 0 24px 60px rgb(0 0 0 / 60%);
  animation: n9-pop-in 0.35s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.n9-modal__dialog h2 { margin: 0; color: var(--n9-copy); font-family: var(--n9-font-heading); font-size: 19px; font-weight: 700; text-align: center; }
.n9-modal__dialog > p { margin: 0; color: rgb(230 215 180 / 65%); font-size: 12.5px; line-height: 1.9; text-align: center; }
.n9-modal__dialog .n9-modal__error { padding: 8px; border-radius: 8px; background: rgb(142 28 28 / 22%); color: #f0b7a8; font-size: 11px; }
.n9-modal__actions { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.n9-modal__actions .n9-gold-button { height: 50px; border-radius: 13px; }

.n9-cancel-button {
  height: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: rgb(230 215 180 / 60%);
  font-size: 13px;
}

@media (min-width: 441px) {
  .n9-app { box-shadow: 0 0 80px rgb(0 0 0 / 50%); }
}

@media (max-width: 380px) {
  .n9-login__panel { padding-inline: 18px; }
  .n9-eyebrow-rule { gap: 8px; }
  .n9-eyebrow-rule p { font-size: 10px; letter-spacing: 3px; }
  .n9-cards { padding-inline: 14px; }
  .n9-mini-brand { gap: 7px; font-size: 11px; letter-spacing: 2px; }
  .n9-mini-brand__mark { width: 34px; height: 34px; }
  .n9-card-row__brand { width: 64px; }
  .n9-card-row__details { padding-inline: 10px 6px; }
  .n9-card-row__action { gap: 5px; padding-right: 9px; }
  .n9-scratch-pill { padding-inline: 10px; }
  .n9-rank-badge { width: 40px; height: 40px; font-size: 13px; }
  .n9-scratch { padding-inline: 14px; }
  .n9-scratch__header > p { padding-right: 44px; font-size: 9px; letter-spacing: 2px; }
  .n9-scratch-card__inner { padding-inline: 10px; }
  .n9-scratch-card__content { grid-template-columns: 104px minmax(0, 1fr); gap-x: 8px; }
  .n9-scratch-card__brand strong { font-size: 9px; letter-spacing: 1.8px; }
  .n9-scratch-card__brand small { font-size: 5.5px; letter-spacing: 1.2px; }
  .n9-scratch-card__expiry { grid-column: 2; }
  .n9-result { padding-inline: 18px; }
}

@media (max-height: 760px) {
  .n9-brand-card__inner { padding-block: 24px 22px; }
  .n9-brand-card__logo { width: 62px; height: 67px; }
  .n9-login__copy { margin-top: 20px; }
  .n9-scratch__body { gap: 16px; padding-block: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .n9-twinkle { opacity: 0.45; }
  .n9-used-panel__stripes { animation: none !important; }
}
