/*
 * bc5-styles.css
 * Badger 5 — Wisconsin Lottery
 * External stylesheet for index.html
 * Dark navy theme using CSS variables
 * Fonts: Boogaloo (display) · Nunito (body)
 */

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  --bg:       #0d1b2e;
  --surface:  #132240;
  --card:     #172a4a;
  --border:   #1e3660;
  --text:     #e8f0ff;
  --muted:    #6b85b0;

  /* Brand colors */
  --red:      #c8102e;
  --darkred:  #8b0a1e;
  --gold:     #f5c518;
  --darkgold: #c9a000;
  --white:    #fff8f0;
  --offwhite: #fff3e0;
  --gray:     #555;
  --black:    #1a1a1a;
  --green:    #1a7a3c;
}

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

/* ============================================================
   BASE
   ============================================================ */
body {
  font-family: 'Nunito', sans-serif;
  background: #1a0a00;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 12px 40px;
  background-image:
    radial-gradient(ellipse at 20% 10%, #3d1a00 0%, transparent 50%),
    radial-gradient(ellipse at 80% 90%, #3d0010 0%, transparent 50%);
}

/* ============================================================
   HEADER
   ============================================================ */
header {
  text-align: center;
  margin-bottom: 28px;
  position: relative;
}

.state-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--red);
  color: var(--white);
  font-family: 'Boogaloo', cursive;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 5px 18px;
  border-radius: 4px 4px 0 0;
  margin-bottom: -2px;
}

.title-box {
  background: linear-gradient(135deg, var(--gold) 0%, #ffe066 40%, var(--darkgold) 100%);
  border: 4px solid var(--darkred);
  border-radius: 16px;
  padding: 18px 40px 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.4);
  position: relative;
  overflow: hidden;
}

.title-box::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 2px dashed rgba(200,16,46,0.4);
  border-radius: 10px;
  pointer-events: none;
}

.badger-emoji {
  font-size: 52px;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
  animation: bounce 2.5s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

h1 {
  font-family: 'Boogaloo', cursive;
  font-size: clamp(42px, 10vw, 72px);
  color: var(--darkred);
  line-height: 0.95;
  text-shadow: 2px 3px 0 rgba(0,0,0,0.15);
  letter-spacing: 1px;
}

h1 span {
  display: block;
  font-size: clamp(18px, 4vw, 28px);
  color: var(--darkred);
  opacity: 0.75;
  letter-spacing: 6px;
}

.subtitle {
  color: var(--darkred);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 4px;
  opacity: 0.8;
}

/* ============================================================
   JACKPOT STRIP
   ============================================================ */
.jackpot-strip {
  background: var(--red);
  border: 3px solid var(--darkred);
  border-radius: 12px;
  padding: 14px 30px;
  text-align: center;
  margin-bottom: 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 4px 20px rgba(200,16,46,0.5);
}

.jackpot-label {
  color: rgba(255,255,255,0.8);
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 2px;
}

.jackpot-amount {
  font-family: 'Boogaloo', cursive;
  font-size: 48px;
  color: var(--gold);
  text-shadow: 0 2px 8px rgba(0,0,0,0.3), 0 0 30px rgba(245,197,24,0.4);
  line-height: 1;
}

.jackpot-note {
  color: rgba(255,255,255,0.6);
  font-size: 11px;
  margin-top: 2px;
}

/* ============================================================
   MAIN CARD
   ============================================================ */
.card {
  background: var(--white);
  border-radius: 20px;
  padding: 28px 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.6);
  border: 3px solid var(--gold);
}

.section-title {
  font-family: 'Boogaloo', cursive;
  font-size: 22px;
  color: var(--darkred);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, var(--red), transparent);
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #e8d8c0;
}

.tab {
  flex: 1;
  padding: 10px 6px;
  background: #f5f0e8;
  border: none;
  font-family: 'Boogaloo', cursive;
  font-size: 14px;
  color: var(--gray);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.tab.active {
  background: var(--red);
  color: #fff;
}

.tab-panel         { display: none; }
.tab-panel.active  { display: block; }

/* ============================================================
   PICK GRID
   ============================================================ */
.pick-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 22px;
}

@media (max-width: 380px) {
  .pick-grid { grid-template-columns: repeat(5, 1fr); }
  .tab { font-size: 12px; padding: 8px 4px; }
}

.pick-ball {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2.5px solid #ddd;
  background: #f5f0e8;
  cursor: pointer;
  font-family: 'Boogaloo', cursive;
  font-size: 17px;
  color: var(--gray);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
  user-select: none;
  position: relative;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.8);
}

.pick-ball:hover:not(.selected):not(.disabled) {
  border-color: var(--red);
  color: var(--red);
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(200,16,46,0.25);
}

.pick-ball.selected {
  background: radial-gradient(circle at 35% 30%, #e63050, var(--red) 60%, var(--darkred));
  border-color: var(--darkred);
  color: #fff;
  box-shadow: 0 4px 14px rgba(200,16,46,0.5), inset 0 1px 0 rgba(255,255,255,0.3);
  transform: scale(1.06);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.pick-ball.disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ============================================================
   SELECTED ROW
   ============================================================ */
.selected-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.sel-ball {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e63050, var(--red) 60%, var(--darkred));
  color: #fff;
  font-family: 'Boogaloo', cursive;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(200,16,46,0.5), inset 0 2px 0 rgba(255,255,255,0.25);
  animation: popIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.sel-ball-empty {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2.5px dashed #ccc;
  background: #f5f0e8;
}

@keyframes popIn {
  0%   { transform: scale(0.3); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.btn {
  flex: 1;
  padding: 13px 10px;
  border: none;
  border-radius: 12px;
  font-family: 'Boogaloo', cursive;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.18s ease;
  letter-spacing: 0.5px;
}

.btn-quick {
  background: linear-gradient(135deg, var(--red), var(--darkred));
  color: #fff;
  box-shadow: 0 4px 16px rgba(200,16,46,0.4);
  border: 2px solid var(--darkred);
}

.btn-quick:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 20px rgba(200,16,46,0.5);
}

.btn-clear {
  background: #f5f0e8;
  color: var(--gray);
  border: 2px solid #ddd;
}

.btn-clear:hover {
  background: #ece5d8;
  border-color: #bbb;
}

.btn-submit {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--gold), var(--darkgold));
  color: var(--darkred);
  border: 3px solid var(--darkgold);
  border-radius: 14px;
  font-family: 'Boogaloo', cursive;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(245,197,24,0.4);
  transition: all 0.18s ease;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(245,197,24,0.55);
}

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

.pick-count {
  text-align: center;
  font-size: 13px;
  color: var(--gray);
  font-weight: 700;
}

.pick-count strong { color: var(--red); }

/* ============================================================
   DIVIDER
   ============================================================ */
.divider {
  height: 2px;
  background: linear-gradient(to right, transparent, #ddd, transparent);
  margin: 20px 0;
}

/* ============================================================
   HISTORY — TICKETS
   ============================================================ */
.ticket {
  background: linear-gradient(135deg, #fff8f0, #fff3e0);
  border: 2px solid #e8d8c0;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

.ticket::before {
  content: '🏆';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 28px;
  opacity: 0.08;
}

.ticket-nums {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: center;
}

.t-ball {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e63050, var(--red) 60%, var(--darkred));
  color: #fff;
  font-family: 'Boogaloo', cursive;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(200,16,46,0.35);
}

.t-ball.match {
  background: radial-gradient(circle at 35% 30%, #3db86a, var(--green));
  box-shadow: 0 2px 8px rgba(26,122,60,0.5);
  animation: glow 1s ease-in-out infinite alternate;
}

@keyframes glow {
  from { box-shadow: 0 2px 8px rgba(26,122,60,0.5); }
  to   { box-shadow: 0 2px 18px rgba(26,122,60,0.9), 0 0 8px rgba(26,122,60,0.5); }
}

.ticket-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.ticket-date {
  font-size: 11px;
  color: #999;
  font-weight: 600;
}

.ticket-result {
  font-size: 12px;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 20px;
}

.result-win     { background: #d4f5e2; color: var(--green); }
.result-pending { background: #fff3cd; color: #856404; }
.result-loss    { background: #fde8ec; color: var(--darkred); }

/* ============================================================
   DRAW SECTION
   ============================================================ */
.draw-section {
  background: var(--black);
  border-radius: 16px;
  padding: 22px 20px;
  text-align: center;
  margin-bottom: 20px;
}

.draw-title {
  color: var(--gold);
  font-family: 'Boogaloo', cursive;
  font-size: 20px;
  margin-bottom: 14px;
  letter-spacing: 2px;
}

.draw-balls {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.draw-ball {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  background: var(--black);
  color: var(--gold);
  font-family: 'Boogaloo', cursive;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.draw-ball.revealed {
  background: radial-gradient(circle at 35% 30%, #f5d94a, var(--gold) 60%, var(--darkgold));
  color: var(--darkred);
  border-color: var(--darkgold);
  box-shadow: 0 0 20px rgba(245,197,24,0.5);
  animation: reveal 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes reveal {
  0%   { transform: rotateY(90deg) scale(0.5); }
  100% { transform: rotateY(0)     scale(1); }
}

.draw-ball .spin {
  animation: spin 0.3s linear infinite;
  color: rgba(245,197,24,0.5);
  font-size: 20px;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.btn-draw {
  background: linear-gradient(135deg, var(--gold), var(--darkgold));
  color: var(--darkred);
  border: none;
  padding: 12px 32px;
  border-radius: 30px;
  font-family: 'Boogaloo', cursive;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(245,197,24,0.4);
  transition: all 0.18s ease;
}

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

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

.draw-note {
  color: rgba(255,255,255,0.4);
  font-size: 11px;
  margin-top: 8px;
}

/* ============================================================
   PRIZE TABLE
   ============================================================ */
.prize-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.prize-table th {
  background: var(--red);
  color: #fff;
  padding: 8px 12px;
  text-align: left;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.prize-table th:last-child { text-align: right; }

.prize-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f0e8dc;
  color: var(--black);
}

.prize-table td:last-child {
  text-align: right;
  font-weight: 900;
  color: var(--green);
}

.prize-table tr:nth-child(even) td { background: #fdf8f0; }

.prize-table tr:first-child td:last-child {
  color: var(--red);
  font-size: 15px;
}

/* ============================================================
   UTILITY
   ============================================================ */
.no-tickets {
  text-align: center;
  color: #bbb;
  font-style: italic;
  padding: 20px;
  font-size: 14px;
}

/* ============================================================
   CONFETTI
   ============================================================ */
.confetti-container {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 999;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg);    opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ============================================================
   WIN BANNER
   ============================================================ */
.win-banner {
  display: none;
  background: linear-gradient(135deg, var(--gold), #ffe066, var(--darkgold));
  border: 3px solid var(--darkgold);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  margin-bottom: 16px;
  animation: bannerPop 0.5s cubic-bezier(0.34,1.56,0.64,1);
}

.win-banner.show { display: block; }

@keyframes bannerPop {
  0%   { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}

.win-banner h2 {
  font-family: 'Boogaloo', cursive;
  color: var(--darkred);
  font-size: 32px;
  margin-bottom: 4px;
}

.win-banner p {
  color: var(--darkred);
  font-weight: 700;
  font-size: 15px;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  margin-top: 28px;
  text-align: center;
  color: rgba(255,255,255,0.2);
  font-size: 11px;
  max-width: 480px;
  line-height: 1.7;
}

footer a { color: rgba(255,255,255,0.35); }
