@import url("https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;1,600&display=swap");
:root {
  --wine: #52180f;
  --wine-dark: #2a0b08;
  --wine-light: #7b2d1c;
  --gold: #d9a43e;
  --gold-pale: #f8df9b;
  --cream: #fff8e9;
  --ink: #36120c;
  font-family: "Be Vietnam Pro", Arial, sans-serif;
  color: var(--wine-dark);
  background: #f8edda;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
}
button,
input,
select {
  font: inherit;
}
.game-page {
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(
      circle at 72% 38%,
      rgba(255, 255, 255, 0.95) 0 12%,
      rgba(255, 247, 225, 0.8) 35%,
      transparent 62%
    ),
    linear-gradient(135deg, #f6dfb2, #fffaf0 46%, #e9bc69);
  position: relative;
}
.game-page:before {
  content: "";
  position: fixed;
  inset: 0;
  opacity: 0.2;
  pointer-events: none;
  background-image:
    linear-gradient(
      112deg,
      transparent 0 49.7%,
      rgba(114, 55, 22, 0.25) 50%,
      transparent 50.3%
    ),
    radial-gradient(
      circle at 18% 70%,
      transparent 0 24%,
      rgba(255, 255, 255, 0.8) 24.2%,
      transparent 24.5%
    );
  background-size:
    70px 70px,
    100% 100%;
}
.ambient {
  position: fixed;
  border: 1px solid rgba(133, 72, 28, 0.2);
  border-radius: 50%;
  pointer-events: none;
}
.ambient-one {
  width: 70vw;
  height: 70vw;
  right: -37vw;
  top: -24vw;
}
.ambient-two {
  width: 45vw;
  height: 45vw;
  left: -27vw;
  bottom: -27vw;
}
.topbar {
  position: relative;
  z-index: 2;
  max-width: 1360px;
  margin: auto;
  padding: 22px clamp(22px, 4vw, 60px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(91, 31, 17, 0.16);
}
.brand img,
.admin-topbar img {
  width: clamp(150px, 17vw, 225px);
  height: 72px;
  object-fit: contain;
  object-position: left center;
  mix-blend-mode: multiply;
}
.event-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #71301f;
}
.game-shell {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: auto;
  min-height: calc(100vh - 155px);
  padding: clamp(28px, 5vw, 72px) clamp(22px, 5vw, 70px);
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(36px, 7vw, 70px);
  align-items: center;
}
.eyebrow {
  margin: 0 0 16px;
  color: #9b681e;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.24em;
}
.copy-panel h1 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(3.6rem, 7vw, 7.1rem);
  line-height: 0.87;
  font-weight: 600;
  letter-spacing: -0.055em;
  color: var(--wine);
}
.copy-panel h1 em {
  display: inline-block;
  margin-left: clamp(20px, 4vw, 56px);
  color: #b77a27;
  font-weight: 600;
  margin-top: 35px;
}
.lead {
  max-width: 470px;
  margin: 32px 0 28px;
  font-size: 1.06rem;
  line-height: 1.7;
  color: #70483c;
}
.prize-note {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-top: 22px;
  border-top: 1px solid rgba(82, 24, 15, 0.2);
  max-width: 420px;
}
.prize-note > span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: var(--cream);
  background: var(--wine);
  font-size: 1.3rem;
}
.prize-note p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
}
.prize-note strong {
  font-family: "Playfair Display", serif;
  font-size: 1.2rem;
  color: var(--wine);
}
.wheel-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.wheel-wrap {
  position: relative;
  width: min(470px, 78vw);
  aspect-ratio: 1;
}
.pointer {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: -15px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 25px solid transparent;
  border-right: 25px solid transparent;
  border-top: 58px solid var(--wine);
  filter: drop-shadow(0 8px 6px rgba(70, 25, 8, 0.2));
}
.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background: conic-gradient(
    from -9deg,
    var(--wine) 0 10deg,
    var(--gold-pale) 10deg 20deg,
    var(--wine-light) 20deg 30deg,
    var(--gold) 30deg 40deg,
    var(--wine) 40deg 50deg,
    var(--cream) 50deg 60deg,
    var(--wine-light) 60deg 70deg,
    var(--gold) 70deg 80deg,
    var(--wine) 80deg 90deg,
    var(--gold-pale) 90deg 100deg,
    var(--wine-light) 100deg 110deg,
    var(--gold) 110deg 120deg,
    var(--wine) 120deg 130deg,
    var(--cream) 130deg 140deg,
    var(--wine-light) 140deg 150deg,
    var(--gold) 150deg 160deg,
    var(--wine) 160deg 170deg,
    var(--gold-pale) 170deg 180deg,
    var(--wine-light) 180deg 190deg,
    var(--gold) 190deg 200deg,
    var(--wine) 200deg 210deg,
    var(--cream) 210deg 220deg,
    var(--wine-light) 220deg 230deg,
    var(--gold) 230deg 240deg,
    var(--wine) 240deg 250deg,
    var(--gold-pale) 250deg 260deg,
    var(--wine-light) 260deg 270deg,
    var(--gold) 270deg 280deg,
    var(--wine) 280deg 290deg,
    var(--cream) 290deg 300deg,
    var(--wine-light) 300deg 310deg,
    var(--gold) 310deg 320deg,
    var(--wine) 320deg 330deg,
    var(--gold-pale) 330deg 340deg,
    var(--wine-light) 340deg 350deg,
    var(--gold) 350deg 360deg
  );
  box-shadow:
    0 26px 65px rgba(88, 42, 11, 0.25),
    inset 0 0 0 10px #f9dda1,
    inset 0 0 0 14px #8b4c17;
}
.wheel:after {
  content: "";
  position: absolute;
  inset: 30px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    #fffaf0 0 48%,
    #f2d08c 49% 53%,
    #5b1c11 54% 57%,
    #fbe7b9 58% 100%
  );
  box-shadow: inset 0 0 35px rgba(133, 75, 23, 0.28);
}
.wheel-rim {
  position: absolute;
  z-index: 2;
  inset: 9px;
  border-radius: 50%;
  border: 3px dotted rgba(255, 249, 224, 0.9);
}
.number-window {
  position: relative;
  z-index: 3;
  width: 52%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #6e2215, #2b0806);
  border: 5px solid #eabf65;
  box-shadow:
    0 13px 28px rgba(43, 8, 6, 0.32),
    inset 0 0 28px rgba(0, 0, 0, 0.35);
}
.number-window span {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(5rem, 10vw, 8rem);
  line-height: 1;
  color: #ffe7a6;
  text-shadow:
    0 2px 0 #8d5618,
    0 0 18px rgba(255, 218, 119, 0.4);
  font-variant-numeric: tabular-nums;
   margin-bottom: 50px;
}
.wheel-caption {
  position: absolute;
  z-index: 3;
  bottom: 19%;
  margin: 0;
  color: #6a291a;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.18em;
 
}
.wheel.spinning {
  animation: spin 2.8s cubic-bezier(0.12, 0.72, 0.17, 1);
}
.wheel.settled .number-window {
  animation: pulse 0.65s ease;
}
.spark {
  position: absolute;
  color: #ca8a2c;
  font-size: 1.4rem;
  animation: twinkle 2s infinite;
}
.spark-a {
  right: 3%;
  top: 9%;
}
.spark-b {
  left: 2%;
  bottom: 26%;
  animation-delay: 0.7s;
}
.spin-button,
.again-button {
  position: relative;
  margin-top: 26px;
  min-width: 245px;
  padding: 15px 30px;
  border: 1px solid #e7bc67;
  border-radius: 999px;
  background: linear-gradient(180deg, #6a2115, #3a0d09);
  color: #fff5d8;
  box-shadow:
    0 10px 0 #b17726,
    0 16px 28px rgba(68, 19, 10, 0.25);
  cursor: pointer;
  transition: 0.2s;
}
.spin-button span {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.spin-button small {
  display: block;
  margin-top: 3px;
  color: #e7c98b;
  font-size: 0.67rem;
}
.spin-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    0 12px 0 #b17726,
    0 20px 32px rgba(68, 19, 10, 0.25);
}
.spin-button:active:not(:disabled) {
  transform: translateY(6px);
  box-shadow: 0 4px 0 #b17726;
}
.spin-button:disabled {
  opacity: 0.7;
  cursor: wait;
}
.status {
  margin: 22px 0 0;
  color: #7b5548;
  font-size: 0.88rem;
}
footer {
  position: relative;
  z-index: 1;
  max-width: 1360px;
  margin: auto;
  padding: 20px clamp(22px, 4vw, 60px);
  display: flex;
  justify-content: space-between;
  color: #805d50;
  border-top: 1px solid rgba(91, 31, 17, 0.16);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}
.result-modal {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(45, 10, 7, 0.72);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: 0.22s;
}
.result-modal[hidden] {
  display: none;
}
.result-modal.visible {
  opacity: 1;
}
.modal-card {
  position: relative;
  width: min(470px, 100%);
  padding: 46px 30px 38px;
  text-align: center;
  background: linear-gradient(150deg, #fffdf5, #f3d592);
  border: 1px solid #f5cd73;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}
.modal-card:before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(99, 38, 20, 0.2);
  pointer-events: none;
}
.modal-card h2 {
  margin: 0;
  font-family: "Playfair Display", serif;
  color: var(--wine);
  font-size: 1.8rem;
}
.modal-number {
  margin: 22px auto 10px;
  font-family: "Playfair Display", serif;
  font-size: 7rem;
  line-height: 1;
  color: var(--wine);
  text-shadow: 0 4px #d9a43e;
}
.modal-close {
  position: absolute;
  z-index: 2;
  right: 14px;
  top: 0px;
  border: 0;
  background: none;
  color: var(--wine);
  font-size: 3rem;
  cursor: pointer;
}
.again-button {
  margin-top: 18px;
  box-shadow: 0 6px 0 #b17726;
}
.admin-page {
  background: #f5ecdc;
  color: var(--ink);
}
.admin-topbar {
  height: 92px;
  padding: 10px clamp(20px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fffaf0;
  border-bottom: 1px solid #dfccb2;
}
.admin-topbar img {
  height: 66px;
}
.logout,
.back-link {
  color: var(--wine);
  font-weight: 700;
  text-decoration: none;
}
.login-shell {
  min-height: calc(100vh - 92px);
  display: grid;
  place-items: center;
  padding: 30px;
  background: radial-gradient(circle at 50% 10%, #fffdf8, #ead1a1);
}
.login-card {
  width: min(440px, 100%);
  padding: 42px;
  background: #fffdf8;
  border: 1px solid #dfc99e;
  box-shadow: 0 25px 70px rgba(80, 37, 13, 0.15);
}
.login-card h1,
.admin-heading h1 {
  margin: 0;
  font-family: "Playfair Display", serif;
  color: var(--wine);
  font-size: 2.4rem;
}
.login-card > p:not(.eyebrow) {
  color: #75564a;
  line-height: 1.6;
}
.login-card form,
.login-card label {
  display: grid;
  gap: 10px;
}
.login-card input,
.quick-set input,
.quick-set select,
.number-cell input {
  min-height: 45px;
  border: 1px solid #cbb89b;
  background: #fff;
  padding: 9px 11px;
  color: var(--ink);
  outline: none;
}
.login-card input:focus,
.quick-set input:focus,
.quick-set select:focus,
.number-cell input:focus {
  border-color: #a26a25;
  box-shadow: 0 0 0 3px rgba(217, 164, 62, 0.2);
}
.login-card button,
.quick-set button,
.save-bar button {
  min-height: 48px;
  border: 0;
  background: var(--wine);
  color: #fff4d9;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.login-card .back-link {
  display: inline-block;
  margin-top: 24px;
}
.admin-shell {
  max-width: 1280px;
  margin: auto;
  padding: 42px clamp(18px, 4vw, 52px) 110px;
}
.admin-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  margin-bottom: 28px;
}
.admin-heading > div > p:last-child {
  color: #76574b;
}
.total-card {
  min-width: 220px;
  padding: 18px 22px;
  background: var(--wine);
  color: #fce8b5;
  display: grid;
  gap: 5px;
}
.total-card span,
.total-card small {
  font-size: 0.76rem;
}
.total-card strong {
  font-family: "Playfair Display", serif;
  font-size: 2rem;
}
.total-card strong.over {
  color: #ff8e73;
}
.alert {
  margin: 0 0 20px;
  padding: 14px 18px;
  border-left: 4px solid;
}
.alert.success {
  background: #e5f3e7;
  border-color: #34834c;
  color: #1c5d30;
}
.alert.error {
  background: #fee4dc;
  border-color: #b53b28;
  color: #7b2115;
}
.quick-set {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 20px;
  background: #fffaf2;
  border: 1px solid #dfccb2;
  position: sticky;
  z-index: 8;
  top: 0;
}
.quick-set label {
  display: grid;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 700;
}
.quick-set input,
.quick-set select {
  width: 125px;
}
.quick-set button {
  padding: 0 22px;
}
.quick-set .ghost-button {
  background: transparent;
  color: var(--wine);
  border: 1px solid #a98766;
}
.number-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  margin-top: 18px;
}
.number-cell {
  min-width: 0;
  padding: 11px 9px;
  background: #fffaf2;
  border: 1px solid #e2d2bb;
}
.number-cell > span {
  display: block;
  margin-bottom: 8px;
  font-family: "Playfair Display", serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--wine);
}
.number-cell > div {
  display: flex;
  align-items: center;
}
.number-cell input {
  width: 100%;
  min-width: 0;
  height: 38px;
  min-height: 38px;
  padding: 6px;
}
.number-cell i {
  margin-left: 4px;
  font-size: 0.75rem;
  font-style: normal;
  color: #90766a;
}
.save-bar {
  position: fixed;
  z-index: 10;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 78px;
  padding: 14px max(24px, calc((100vw - 1176px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(255, 250, 240, 0.95);
  border-top: 1px solid #d8c3a4;
  backdrop-filter: blur(10px);
}
.save-bar p {
  margin: 0;
  color: #775b50;
  font-size: 0.84rem;
}
.save-bar button {
  padding: 0 34px;
}
.save-bar button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
@keyframes spin {
  to {
    transform: rotate(1800deg);
  }
}
@keyframes pulse {
  50% {
    transform: scale(1.07);
    box-shadow:
      0 18px 38px rgba(43, 8, 6, 0.42),
      0 0 0 12px rgba(239, 188, 77, 0.2);
  }
}
@keyframes twinkle {
  50% {
    opacity: 0.25;
    transform: scale(0.7) rotate(45deg);
  }
}
@media (max-width: 900px) {
  .game-shell {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .copy-panel h1 {
    font-size: clamp(3.3rem, 14vw, 5.8rem);
  }
  .copy-panel h1 em {
    margin-left: 0;
  }
  .lead,
  .prize-note {
    margin-left: auto;
    margin-right: auto;
  }
  .prize-note {
    text-align: left;
  }
  .number-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  .admin-heading {
    align-items: stretch;
  }
  .total-card {
    min-width: 190px;
  }
  .quick-set {
    flex-wrap: wrap;
    position: relative;
  }
}
@media (max-width: 560px) {
  .topbar {
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .brand img {
    width: 142px;
    height: 60px;
  }
  .event-label {
    font-size: 0.58rem;
    letter-spacing: 0.1em;
  }
  .game-shell {
    padding-top: 34px;
    gap: 30px;
  }
  .copy-panel h1 {
    font-size: 3.6rem;
  }
  .lead {
    margin-top: 22px;
  }
  .wheel-wrap {
    width: min(365px, 88vw);
  }
  .wheel:after {
    inset: 23px;
  }
  .number-window span {
    font-size: 5.2rem;
  }
  .wheel-caption {
    bottom: 18%;
    font-size: 0.52rem;
  }
  .pointer {
    border-left-width: 18px;
    border-right-width: 18px;
    border-top-width: 43px;
  }
  .spin-button {
    margin-top: 20px;
  }
  .spark {
    display: none;
  }
  footer {
    justify-content: center;
  }
  footer span:last-child {
    display: none;
  }
  .admin-topbar {
    height: 78px;
  }
  .admin-topbar img {
    width: 150px;
    height: 58px;
  }
  .admin-shell {
    padding-top: 26px;
  }
  .admin-heading {
    display: grid;
  }
  .admin-heading h1 {
    font-size: 2rem;
  }
  .total-card {
    width: 100%;
  }
  .quick-set > * {
    flex: 1 1 42%;
  }
  .quick-set input,
  .quick-set select {
    width: 100%;
  }
  .quick-set button {
    padding: 0 8px;
    font-size: 0.73rem;
  }
  .number-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .save-bar {
    padding: 12px 16px;
  }
  .save-bar p {
    display: none;
  }
  .save-bar button {
    width: 100%;
  }
  .login-card {
    padding: 32px 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
