/*! HTML5 Boilerplate v9.0.1 | MIT License | https://html5boilerplate.com/ */

/* main.css 3.0.0 | MIT License | https://github.com/h5bp/main.css#readme */
/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html {
  color: #222;
  font-size: 1.2em;
  line-height: 1.4;
}

/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * Customize the background color to match your design.
 */

::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}

::selection {
  background: #b3d4fc;
  text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
  resize: vertical;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */

:root {
  /* Casino / red machine theme */
  --bg0: #120006;
  --bg1: #2a000c;

  --card: rgba(255, 210, 140, 0.06);
  --card2: rgba(255, 210, 140, 0.10);
  --stroke: rgba(255, 210, 140, 0.18);

  --text: rgba(255, 245, 235, 0.96);
  --muted: rgba(255, 235, 220, 0.72);
  --muted2: rgba(255, 235, 220, 0.52);

  --accent: #ffcc66;   /* gold */
  --accent2: #ff3b6a;  /* hot red */
  --danger: #ff4d6d;

  --shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  --radius: 18px;

  --gold-strong: rgba(255, 204, 102, 0.92);
  --gold-soft: rgba(255, 204, 102, 0.35);
  --red-shell: rgba(132, 0, 24, 0.85);
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color: var(--text);

  /* Casino backdrop: dark red velvet + spotlight */
  background:
    radial-gradient(1200px 800px at 30% 20%, rgba(255, 204, 102, 0.18), transparent 58%),
    radial-gradient(800px 700px at 80% 35%, rgba(255, 59, 106, 0.14), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px 14px;
}

.topbar::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 204, 102, 0.45), transparent);
}

.brand__title {
  font-weight: 900;
  letter-spacing: 0.8px;
  font-size: 18px;
  text-transform: uppercase;
}

.brand__subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.topbar__actions {
  display: flex;
  gap: 10px;
}

.layout {
  padding: 0 22px 22px;
  flex: 1;
  display: grid;
  grid-template-columns: 3fr 7fr;
  gap: 16px;
}

.panel {
  position: relative;

  /* machine shell */
  background:
    radial-gradient(900px 700px at 20% 10%, rgba(255, 204, 102, 0.06), transparent 60%),
    linear-gradient(180deg, rgba(115, 0, 24, 0.72), rgba(28, 0, 8, 0.82));
  border: 1px solid rgba(255, 204, 102, 0.22);
  border-radius: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow: hidden;
}

/* marquee bulb border */
.panel::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 14px;
  pointer-events: none;

  /* Dotted golden bulbs (widely supported) */
  border: 8px dotted rgba(255, 214, 140, 0.55);
  box-shadow:
    inset 0 0 0 2px rgba(255, 204, 102, 0.18),
    0 0 18px rgba(255, 204, 102, 0.12);
  opacity: 0.9;
}

.panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 16px 10px;
  border-bottom: 1px solid rgba(255, 204, 102, 0.12);
}

.panel__title {
  margin: 0;
  font-size: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(255, 204, 102, 0.12);
  border: 1px solid rgba(255, 204, 102, 0.45);
  color: rgba(255, 245, 235, 0.95);
}

.controls {
  display: grid;
  grid-template-columns: 2fr 2fr 1.2fr;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.controls__buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-size: 12px;
  color: var(--muted);
}

.field__control {
  border-radius: 14px;
  border: 1px solid rgba(255, 204, 102, 0.22);
  background: rgba(0, 0, 0, 0.26);
  height: 38px;
  padding: 0 12px;
  outline: none;
  color: var(--text);
}

.field__control:focus {
  border-color: rgba(255, 204, 102, 0.65);
  box-shadow: 0 0 0 4px rgba(255, 204, 102, 0.18);
}

.btn {
  height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 204, 102, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.08));
  color: var(--text);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: transform 120ms ease, background 150ms ease, border-color 150ms ease;
  user-select: none;
}

.btn:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.10));
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn--primary {
  border-color: rgba(255, 204, 102, 0.55);
  background:
    radial-gradient(220px 120px at 20% 20%, rgba(255, 255, 255, 0.22), transparent 60%),
    linear-gradient(180deg, rgba(255, 59, 106, 0.98), rgba(180, 0, 38, 0.92));
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.35),
    0 0 22px rgba(255, 59, 106, 0.20);
}

.btn--primary:hover {
  filter: brightness(1.05);
}

.btn--ghost {
  background: rgba(0, 0, 0, 0.12);
}

.icon-btn {
  border-radius: 14px;
  border: 1px solid rgba(255, 204, 102, 0.22);
  background: rgba(0, 0, 0, 0.15);
}

.wheel-stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: 18px 16px;
}

.wheel-canvas {
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.10), rgba(0, 0, 0, 0.62)),
    radial-gradient(700px 520px at 40% 25%, rgba(255, 204, 102, 0.08), transparent 60%);
  box-shadow:
    0 26px 80px rgba(0, 0, 0, 0.70),
    0 0 0 10px rgba(255, 204, 102, 0.10),
    0 0 0 1px rgba(255, 204, 102, 0.14);
  width: min(78vh, 560px);
  height: min(78vh, 560px);
  border-radius: 999px;
}

.wheel-pointer {
  filter:
    drop-shadow(0 8px 16px rgba(0, 0, 0, 0.45))
    drop-shadow(0 0 14px rgba(255, 204, 102, 0.25));
  position: absolute;
  top: 10px;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-bottom: 22px solid rgba(255, 245, 235, 0.95);
}

.wheel-center {
  width: 124px;
  height: 124px;
  border-radius: 999px;
  background:
    radial-gradient(70px 70px at 30% 25%, rgba(255, 255, 255, 0.22), transparent 60%),
    linear-gradient(180deg, rgba(255, 204, 102, 0.25), rgba(0, 0, 0, 0.10));
  border: 1px solid rgba(255, 204, 102, 0.28);
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.45),
    0 0 22px rgba(255, 204, 102, 0.18);
  position: absolute;
  display: grid;
  place-items: center;
}

.wheel-center__label {
  font-weight: 1000;
  letter-spacing: 1.2px;
  background: linear-gradient(135deg, rgba(255, 238, 200, 1), rgba(255, 204, 102, 1));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.status {
  padding: 0 16px 16px;
}

.status__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
}

.status__label {
  color: var(--muted);
  font-size: 12px;
}

.status__value {
  font-weight: 700;
}

.status__value--big {
  font-size: 18px;
}

.status__hint {
  color: var(--muted2);
  font-size: 12px;
  margin-top: 6px;
}

.empty {
  padding: 16px;
  color: var(--muted);
}

.empty__title {
  font-weight: 800;
  color: var(--text);
}

.ann-list {
  margin: 0;
  padding: 10px 10px 16px 28px;
  list-style: decimal;
  max-height: calc(100vh - 210px);
  overflow: auto;
}

.ann-item {
  background: rgba(0, 0, 0, 0.14);
  border: 1px solid rgba(255, 204, 102, 0.14);
  border-radius: 14px;
  padding: 10px 12px;
  margin: 10px 12px 0 0;
  animation: popIn 260ms ease both;
}

.ann-item__top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.ann-prize {
  color: rgba(255, 230, 190, 0.98);
  font-weight: 800;
}

.ann-time {
  color: var(--muted2);
  font-size: 12px;
  white-space: nowrap;
}

.ann-winner {
  margin-top: 6px;
  font-size: 14px;
}

@keyframes popIn {
  from {
    transform: translateY(6px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.footer {
  padding: 10px 22px 18px;
}

.footer__text {
  color: var(--muted2);
  font-size: 12px;
}

/* Modal */
.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 50;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.70);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 160ms ease both;
}

.modal__dialog {
  position: relative;
  width: min(980px, calc(100vw - 28px));
  max-height: min(86vh, 900px);
  overflow: auto;
  border-radius: 18px;
  background:
    radial-gradient(900px 700px at 40% 10%, rgba(255, 204, 102, 0.08), transparent 55%),
    linear-gradient(180deg, rgba(60, 0, 14, 0.98), rgba(12, 0, 4, 0.98));
  border: 1px solid rgba(255, 204, 102, 0.18);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: riseIn 200ms ease both;
}

.modal__header,
.modal__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal__footer {
  border-bottom: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.modal__title {
  margin: 0;
  font-size: 15px;
}

.modal__body {
  padding: 16px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes riseIn {
  from {
    transform: translateY(10px) scale(0.985);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.admin-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 16px;
  padding: 14px;
}

.admin-card__title {
  margin: 0 0 10px;
  font-size: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 120px 92px;
  gap: 8px;
  align-items: center;
}

.form-row--right {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

.textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  outline: none;
  color: var(--text);
  background: rgba(0, 0, 0, 0.22);
}

.hint {
  margin-top: 8px;
  color: var(--muted2);
  font-size: 12px;
}

.mini {
  color: var(--muted);
  font-size: 12px;
}

.table {
  display: grid;
  gap: 8px;
}

.table-row {
  display: grid;
  grid-template-columns: 1.8fr 0.8fr 0.9fr 70px;
  gap: 8px;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 12px;
}

.table-row__muted {
  color: var(--muted2);
  font-size: 12px;
}

.btn--danger {
  border-color: rgba(255, 77, 109, 0.5);
  background: rgba(255, 77, 109, 0.12);
}

.btn--danger:hover {
  background: rgba(255, 77, 109, 0.18);
}

.fairness-controls {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 160px;
  gap: 10px;
  align-items: end;
}

.fairness-section {
  margin-top: 14px;
}

.sub {
  margin: 6px 0 10px;
  font-size: 13px;
  color: var(--text);
}

@media only screen and (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .controls__buttons {
    justify-content: flex-start;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .fairness-controls {
    grid-template-columns: 1fr;
  }
}

/* optional: reduce motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
