/* ============================================================
   Global
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --gold: #f5c518;
  --gold-dark: #c9a00e;
  --bg: #1a0a2e;
  --bg2: #2d1050;
  --bg3: #3d1a6e;
  --text: #f0e6ff;
  --text-muted: #a89bc0;
  --accent: #ff6baf;
  --accent2: #6bffdf;
  --shadow: 0 4px 32px rgba(0,0,0,0.6);
  --radius: 12px;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ============================================================
   App Layout
   ============================================================ */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--bg2);
  border-bottom: 2px solid var(--gold);
  box-shadow: var(--shadow);
}

.header h1 {
  font-size: 1.8rem;
  color: var(--gold);
  text-shadow: 0 0 12px var(--gold-dark);
  letter-spacing: 2px;
}

.admin-link {
  color: var(--gold);
  text-decoration: none;
  font-size: 1rem;
  padding: 0.4rem 1rem;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s;
}

.admin-link:hover {
  background: var(--gold);
  color: var(--bg);
}

/* ============================================================
   Main Content
   ============================================================ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  gap: 2rem;
}

.columns {
  display: flex;
  gap: 2.5rem;
  align-items: stretch;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 1000px;
}

/* ============================================================
   Column
   ============================================================ */
.column {
  flex: 1;
  min-width: 280px;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.column-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.key-hint {
  display: inline-block;
  background: var(--bg3);
  border: 1px solid var(--gold);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.9rem;
  color: var(--gold);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* ============================================================
   Slot Machine
   ============================================================ */
.slot-machine {
  width: 100%;
  background: linear-gradient(180deg, #0d0025 0%, #1a0a2e 40%, #0d0025 100%);
  border: 3px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: 0 0 24px rgba(245, 197, 24, 0.35), inset 0 0 20px rgba(0,0,0,0.5);
  overflow: hidden;
  position: relative;
}

/* Top & bottom fade overlays */
.slot-machine::before,
.slot-machine::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 60px;
  z-index: 2;
  pointer-events: none;
}
.slot-machine::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(26,10,46,0.95), transparent);
}
.slot-machine::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(26,10,46,0.95), transparent);
}

.slot-window {
  height: 180px;
  overflow: hidden;
  position: relative;
}

.slot-reel {
  display: flex;
  flex-direction: column;
  transition: transform 0s;
}

.slot-item {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.5rem;
  font-size: 1rem;
  text-align: center;
  font-weight: 500;
  color: var(--text);
  flex-shrink: 0;
  line-height: 1.3;
}

.slot-item.placeholder {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9rem;
}

.slot-item.winner {
  color: var(--gold);
  font-size: 1.1rem;
  font-weight: 700;
  text-shadow: 0 0 10px var(--gold-dark);
}

/* Highlight bar in the center of the window */
.slot-machine .highlight {
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 60px;
  transform: translateY(-50%);
  border-top: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  background: rgba(245, 197, 24, 0.06);
  z-index: 1;
  pointer-events: none;
}

/* ============================================================
   Draw Button
   ============================================================ */
.draw-btn {
  padding: 0.65rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--bg);
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(245, 197, 24, 0.4);
  transition: transform 0.1s, box-shadow 0.1s, opacity 0.2s;
  letter-spacing: 1px;
}

.draw-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 197, 24, 0.55);
}

.draw-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(245, 197, 24, 0.3);
}

.draw-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ============================================================
   Hints
   ============================================================ */
.hints {
  display: flex;
  gap: 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  opacity: 0.7;
}

/* ============================================================
   Admin Page
   ============================================================ */
.admin-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.admin-page h1 {
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-block;
  margin-bottom: 2rem;
  transition: color 0.2s;
}

.back-link:hover { color: var(--gold); }

.admin-sections {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.admin-section {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.admin-section h2 {
  font-size: 1.2rem;
  color: var(--gold);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--bg3);
}

/* Add form */
.add-form {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.add-form input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: 0.6rem 1rem;
  background: var(--bg3);
  border: 1px solid var(--bg3);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.add-form input[type="text"]:focus {
  border-color: var(--gold);
}

.btn {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.1s;
}

.btn:hover { opacity: 0.85; }
.btn:active { transform: scale(0.97); }

.btn-add {
  background: var(--gold);
  color: var(--bg);
}

.btn-delete {
  background: #c0392b;
  color: white;
}

.btn-save {
  background: #27ae60;
  color: white;
}

.btn-toggle {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--text-muted);
}

.btn-toggle.active {
  background: #27ae60;
  color: white;
  border-color: #27ae60;
}

.btn-toggle.inactive {
  background: #c0392b;
  color: white;
  border-color: #c0392b;
  opacity: 0.75;
}

/* Item list */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.item-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  border-radius: 8px;
  flex-wrap: wrap;
}

.item-row.inactive-row {
  opacity: 0.5;
}

.item-row input[type="text"] {
  flex: 1;
  min-width: 140px;
  padding: 0.4rem 0.75rem;
  background: var(--bg3);
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.item-row input[type="text"]:focus {
  border-color: var(--gold);
}

.item-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.empty-msg {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 1rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--bg3);
  color: var(--text);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  border-left: 4px solid var(--gold);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 9999;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}
