:root {
  --bg: #0d0502;
  --panel: rgba(18, 7, 3, 0.7);
  --panel-soft: rgba(255, 111, 0, 0.12);
  --line: rgba(255, 143, 48, 0.32);
  --text: #fff8ef;
  --muted: rgba(255, 248, 239, 0.62);
  --orange: #ff6900;
  --amber: #ffb000;
  --danger: #ff4d4f;
  --green: #52c41a;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Bahnschrift", "Aptos Display", "Microsoft YaHei UI", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  content: "";
  background-color: var(--bg);
  background-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0.12), rgba(255, 87, 0, 0.07)),
    url("./assets/bg.png");
  background-repeat: no-repeat;
  background-size: 100% 100%, contain;
  background-position: center, center bottom;
}

body::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at 52% 42%, rgba(255, 119, 0, 0.18), transparent 34%),
    radial-gradient(circle at 12% 82%, rgba(255, 176, 0, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.42));
  mix-blend-mode: screen;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.screen-shell {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  padding: clamp(34px, 4vw, 76px);
}

.reset-hotspot {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 20;
  width: 120px;
  height: 120px;
  border: 0;
  background: transparent;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 105, 0, 0.12);
  color: #ffd9be;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.status-pill::before {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 22px var(--amber);
  content: "";
}

.lock-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 500px);
  gap: clamp(36px, 8vw, 140px);
  align-items: center;
  width: min(1200px, 86vw);
  height: 100%;
  margin: 0 auto;
  animation: lift-in 680ms cubic-bezier(0.2, 0.9, 0.18, 1) both;
}

.lock-copy h1,
.center-panel h1,
.activity-screen h1,
.stage-header h1 {
  margin: 18px 0 14px;
  font-size: clamp(44px, 6vw, 96px);
  line-height: 0.95;
  letter-spacing: 0.08em;
}

.lock-copy p,
.center-panel p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(17px, 1.45vw, 24px);
  line-height: 1.75;
}

.password-box,
.center-panel {
  border: 1px solid var(--line);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 105, 0, 0.12), rgba(255, 255, 255, 0.04)),
    rgba(12, 4, 1, 0.68);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 32px 90px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.password-box {
  display: grid;
  gap: 18px;
  padding: clamp(30px, 3.6vw, 48px);
}

.password-box label {
  color: #ffd9be;
  font-size: 15px;
  letter-spacing: 0.18em;
}

.password-box input {
  width: 100%;
  height: 76px;
  border: 1px solid rgba(255, 176, 0, 0.42);
  border-radius: 22px;
  outline: none;
  background: rgba(255, 248, 239, 0.08);
  color: var(--text);
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-align: center;
}

.password-box button,
.primary-action,
.draw-button {
  min-height: 62px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--amber), var(--orange));
  color: #180600;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.12em;
  box-shadow: 0 18px 50px rgba(255, 105, 0, 0.26);
}

.error-line {
  color: #ffd6d6;
  font-size: 15px;
  line-height: 1.6;
}

.error-line--stage {
  margin-top: 22px;
  text-align: center;
}

.center-panel {
  position: absolute;
  left: 50%;
  top: 52%;
  width: min(760px, 82vw);
  padding: 44px 52px;
  transform: translate(-50%, -50%);
  text-align: center;
  animation: lift-in 680ms cubic-bezier(0.2, 0.9, 0.18, 1) both;
}

.center-panel--loading h1 {
  font-size: clamp(34px, 4.8vw, 74px);
}

.center-panel--empty {
  top: 57%;
  width: min(520px, 68vw);
  padding: 30px 34px 28px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 105, 0, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(12, 4, 1, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 20px 54px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
}

.center-panel--empty .status-pill {
  min-height: 30px;
  padding: 5px 13px;
  font-size: 12px;
}

.center-panel--empty h1 {
  margin: 14px 0 12px;
  font-size: clamp(34px, 4vw, 58px);
  letter-spacing: 0.04em;
}

.center-panel--empty p {
  max-width: 430px;
  margin: 0 auto;
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.65;
}

.center-panel--empty .primary-action {
  min-height: 52px;
  margin-top: 20px;
  padding: 0 24px;
  font-size: 16px;
}

.activity-screen {
  width: min(1320px, 90vw);
  height: 100%;
  margin: 0 auto;
  padding-top: clamp(12px, 2vw, 30px);
  animation: lift-in 680ms cubic-bezier(0.2, 0.9, 0.18, 1) both;
}

.screen-header,
.stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.screen-header h1 {
  font-size: clamp(40px, 5vw, 78px);
}

.ghost-action {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 248, 239, 0.08);
  color: #ffd9be;
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 36px;
}

.activity-item {
  min-height: 190px;
  padding: 30px;
  border: 1px solid rgba(255, 146, 58, 0.24);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255, 105, 0, 0.14), rgba(255, 255, 255, 0.04)),
    rgba(14, 5, 2, 0.52);
  color: var(--text);
  text-align: left;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.26);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.activity-item:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 176, 0, 0.58);
  background:
    radial-gradient(circle at 86% 16%, rgba(255, 176, 0, 0.18), transparent 32%),
    linear-gradient(135deg, rgba(255, 105, 0, 0.2), rgba(255, 255, 255, 0.06)),
    rgba(14, 5, 2, 0.6);
}

.activity-item strong {
  display: block;
  margin: 16px 0;
  font-size: clamp(26px, 2.5vw, 42px);
  line-height: 1.15;
}

.activity-item span {
  display: block;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.activity-item__meta {
  color: var(--amber) !important;
  letter-spacing: 0.12em;
}

.stage {
  height: 100%;
  animation: lift-in 680ms cubic-bezier(0.2, 0.9, 0.18, 1) both;
}

.stage--review {
  min-height: 100%;
  height: auto;
  padding-bottom: clamp(18px, 3vh, 42px);
}

.stage-header h1 {
  max-width: 900px;
  font-size: clamp(30px, 4.2vw, 70px);
  text-align: center;
}

.stage-kicker {
  color: var(--orange);
  font-size: clamp(20px, 1.8vw, 34px);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-align: center;
  text-shadow: 0 0 28px rgba(255, 105, 0, 0.4);
}

.slots {
  display: grid;
  grid-template-columns: repeat(var(--slot-count), minmax(0, 1fr));
  gap: clamp(18px, 3.6vw, 72px);
  align-items: stretch;
  width: min(1460px, 88vw);
  margin: clamp(34px, 5.8vh, 78px) auto 0;
}

.stage--review .slots {
  margin-top: clamp(0px, 1.2vh, 14px);
}

.stage--review .slot {
  min-height: clamp(110px, 11vw, 164px);
  padding: clamp(4px, 0.8vw, 12px) 0;
}

.stage--review .slot__name {
  margin-top: 6px;
}

.stage--review .slot__phone {
  margin-top: 8px;
}

.slot {
  min-width: 0;
  min-height: clamp(156px, 17vw, 228px);
  padding: clamp(18px, 2vw, 30px) 0;
  text-align: center;
  transform: translateY(18px);
  opacity: 0;
  animation: slot-in 680ms cubic-bezier(0.2, 0.9, 0.18, 1) forwards;
}

.slot:nth-child(2) {
  animation-delay: 110ms;
}

.slot:nth-child(3) {
  animation-delay: 220ms;
}

.slot__name {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 1.2em;
  margin-top: 26px;
  overflow: hidden;
  color: #fff8ef;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow:
    0 0 20px rgba(255, 255, 255, 0.22),
    0 18px 50px rgba(0, 0, 0, 0.48);
}

.slot__phone {
  min-height: 28px;
  margin-top: 14px;
  overflow: hidden;
  color: rgba(255, 248, 239, 0.7);
  font-size: clamp(18px, 1.35vw, 24px);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot--masked .slot__name {
  color: rgba(255, 248, 239, 0.45);
  font-weight: 700;
  letter-spacing: 0.16em;
}

.slot--winner {
  background: none;
}

.slot--winner .slot__name {
  animation: reveal-name 720ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.slot--spinning {
  background: none;
  opacity: 1;
  transform: none;
  animation: none;
}

.slot--spinning .slot__name {
  color: #fff8ef;
  opacity: 0.92;
  filter: none;
  transform: translateZ(0);
  text-shadow:
    0 0 18px rgba(255, 176, 0, 0.28),
    0 0 44px rgba(255, 105, 0, 0.18);
  animation: rolling-name 360ms linear infinite;
  will-change: filter, transform, opacity;
}

.slot--spinning .slot__phone {
  animation: rolling-phone 360ms linear infinite;
  will-change: filter, opacity;
}

.winner-review {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  width: min(1500px, 86vw);
  margin: clamp(8px, 1.4vh, 16px) auto 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
  user-select: none;
  overscroll-behavior-x: contain;
}

.winner-review::-webkit-scrollbar {
  display: none;
}

.winner-review--dragging {
  cursor: grabbing;
}

.review-winner {
  flex: 0 0 292px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  min-width: 0;
  min-height: 62px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 176, 0, 0.22);
  border-radius: 8px;
  background: rgba(18, 7, 3, 0.48);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.review-winner strong,
.review-winner span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-winner__identity {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}

.review-winner strong {
  color: #fff8ef;
  font-size: 16px;
  letter-spacing: 0.03em;
}

.review-winner__identity > span {
  color: rgba(255, 248, 239, 0.58);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.review-winner__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.review-winner--voided {
  border-color: rgba(255, 77, 79, 0.28);
  background: rgba(45, 7, 5, 0.42);
}

.review-winner__status {
  min-width: 60px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: left;
  white-space: nowrap;
}

.review-winner__status--confirmed {
  color: var(--green);
}

.review-winner__status--voided_absent,
.review-winner__status--voided_waived {
  color: var(--danger);
}

.review-winner__actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
  justify-content: flex-end;
}

.review-winner__actions button {
  min-width: 58px;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(255, 176, 0, 0.34);
  border-radius: 999px;
  background: rgba(12, 4, 1, 0.52);
  color: #ffd9be;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
}

.review-winner__actions button:not(:disabled):hover {
  border-color: rgba(255, 176, 0, 0.72);
  background: rgba(255, 105, 0, 0.16);
}

.draw-controls {
  position: fixed;
  left: 50%;
  bottom: clamp(8px, 1.8vh, 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transform: translateX(-50%);
}

.draw-controls--review {
  position: static;
  left: auto;
  bottom: auto;
  flex-direction: row;
  justify-content: center;
  width: min(620px, 86vw);
  margin: clamp(10px, 1.6vh, 18px) auto 0;
  transform: none;
}

.draw-button {
  min-width: 280px;
  padding: 0 42px;
  font-size: 22px;
}

.skip-reveal-button {
  min-width: 220px;
  min-height: 44px;
  padding: 0 26px;
  border: 1px solid rgba(255, 176, 0, 0.52);
  border-radius: 999px;
  background: rgba(12, 4, 1, 0.58);
  color: #ffd9be;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.1em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 36px rgba(255, 105, 0, 0.16);
}

.confirm-round-button {
  border: 1px solid rgba(82, 196, 26, 0.52);
  border-radius: 999px;
  background: rgba(8, 42, 14, 0.48);
  color: #d9f7be;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.1em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 12px 36px rgba(82, 196, 26, 0.14);
}

.draw-controls--review .draw-button {
  min-width: 220px;
  min-height: 50px;
  padding: 0 30px;
  font-size: 18px;
}

.confirm-round-button:not(:disabled):hover {
  border-color: rgba(82, 196, 26, 0.82);
  background: rgba(82, 196, 26, 0.16);
}

.skip-reveal-button:not(:disabled):hover {
  border-color: rgba(255, 176, 0, 0.82);
  background: rgba(255, 105, 0, 0.16);
}

.draw-controls span {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.12em;
}

.connection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
  color: rgba(255, 248, 239, 0.68);
  font-size: 14px;
  letter-spacing: 0.12em;
}

.connection::before {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px var(--green);
  content: "";
}

.connection--offline::before {
  background: var(--danger);
  box-shadow: 0 0 14px var(--danger);
}

@keyframes lift-in {
  from {
    transform: translateY(18px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slot-in {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes reveal-name {
  from {
    filter: blur(14px);
    transform: scale(0.94);
    opacity: 0.08;
  }

  to {
    filter: blur(0);
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes rolling-name {
  0% {
    filter: blur(0);
    transform: translateY(0) scale(1);
    opacity: 0.92;
  }

  45% {
    filter: blur(5px);
    transform: translateY(-8px) scale(0.985);
    opacity: 0.58;
  }

  46% {
    filter: blur(5px);
    transform: translateY(8px) scale(0.985);
    opacity: 0.58;
  }

  100% {
    filter: blur(0);
    transform: translateY(0) scale(1);
    opacity: 0.92;
  }
}

@keyframes rolling-phone {
  0% {
    filter: blur(0);
    opacity: 0.74;
  }

  50% {
    filter: blur(4px);
    opacity: 0.34;
  }

  100% {
    filter: blur(0);
    opacity: 0.74;
  }
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .screen-shell {
    min-height: 100vh;
    height: auto;
    padding: 28px;
  }

  .lock-screen {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }

  .activity-grid,
  .slots {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .stage-header,
  .screen-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .draw-controls {
    position: relative;
    left: auto;
    bottom: auto;
    margin-top: 36px;
    transform: none;
  }

  .review-winner {
    grid-template-columns: 1fr;
  }

  .review-winner__status {
    text-align: left;
  }

  .review-winner__actions {
    flex-wrap: wrap;
  }
}
