/* 
  Lucky Bingo! - style.css
*/

@font-face {
  font-family: CossetteTexte-Regular;
  src: url(../fonts/CossetteTexte-Regular.ttf);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "CossetteTexte-Regular", sans-serif;
}

:root {
  --bg: #0d3d0f;
  --surface: #00d900;
  --surface2: #1a6420;
  --border: #2a7a30;
  --text: #ffffff;
  --muted: #7ec882;
  --green: #4ec923;
  --green-light: #8edf2a;
  --green-dark: #1a5c00;
  --gold: #f5c518;
  --ball-shadow: 0 8px 40px rgba(78, 201, 35, 0.35);
  --black: #000;
}

html,
body {
  min-height: 100%;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 48px;
  background: radial-gradient(ellipse at top, #1a6020 0%, #0d3d0f 60%), #0d3d0f;
}

/* ── HEADER ── */
header {
  width: 100%;
  max-width: 800px;
  padding: 10px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  width: 170px;
}
.logo img {
  width: 100%;
}

.sound-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 40px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text);
  transition: all 0.2s;
  -webkit-user-select: none;
  user-select: none;
}

.sound-toggle.on {
  color: var(--text);
  border-color: var(--green);
  background: var(--surface);
}
.sound-toggle svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ── SHAMROCK BAR ── */
.shamrock-leaf {
  margin-top: 18px;
  width: 100%;
  max-width: 800px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--border);
  font-size: 1rem;
}
.shamrock-leaf::before,
.shamrock-leaf::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
  opacity: 0.5;
}
.shamrock-leaf img {
  width: 30px;
}

/* ── BALL ── */
.ball-section {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.ball-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
}

.ball {
  width: 186px;
  height: 220px;
  border-radius: 10px;
  background: var(--text);
  border: 1px solid var(--black);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow:
    var(--ball-shadow),
    inset 0 -6px 20px rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: hidden;
}

.ball::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.5) 0%,
    transparent 55%
  );
  pointer-events: none;
}

.ball.pop {
  animation: ballPop 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes ballPop {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.15);
  }
  60% {
    transform: scale(0.96);
  }
  100% {
    transform: scale(1);
  }
}

.ball-number {
  font-size: 8rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0px;
  background: linear-gradient(
    339deg,
    rgba(1, 2, 18, 1) 40%,
    rgba(0, 0, 0, 0.74) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.ball-empty .ball-number {
  background: none;
  -webkit-text-fill-color: #c8e6c8;
  color: #c8e6c8;
  font-size: 3rem;
  letter-spacing: 0;
}

.ball-word {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--black);
  margin-top: 2px;
  font-style: italic;
  opacity: 0.7;
}

/* ── COUNTER ── */
.counter {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
}
.counter strong {
  color: var(--green-light);
  font-size: 1rem;
}

/* ── BUTTONS ── */
.actions {
  margin-top: 22px;
  display: flex;
  gap: 10px;
  padding: 0 20px;
  width: 100%;
  max-width: 800px;
}

.btn {
  flex: 1;
  padding: 16px 12px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  transition: all 0.16s;
  -webkit-appearance: none;
  appearance: none;
}

.btn-primary {
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  background: linear-gradient(160deg, var(--green-light) 0%, var(--green) 100%);
  color: var(--green-dark);
  box-shadow:
    0 4px 0 #1a5c00,
    0 6px 20px rgba(78, 201, 35, 0.35);
}
.btn-primary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #1a5c00;
}
.btn-primary:disabled {
  background: var(--surface2);
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
}
.btn-primary.pausing {
  background: linear-gradient(160deg, #f5c518 0%, #e6a800 100%);
  color: #3d2800;
  box-shadow:
    0 4px 0 #7a5000,
    0 6px 20px rgba(245, 197, 24, 0.35);
}

.btn-auto {
  font-size: 1rem;
  background: var(--surface2);
  color: var(--text);
  border: 1.5px solid var(--green);
  flex: 0.7;
}

.btn-auto:active {
  transform: translateY(2px);
}

.btn-auto.active {
  background: var(--gold);
  color: var(--green-dark);
  border-color: var(--gold);
  box-shadow:
    0 4px 0 #b8960f,
    0 6px 16px rgba(245, 197, 24, 0.35);
}

.btn-auto.active:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #b8960f;
}

.btn-secondary {
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-secondary:active {
  transform: translateY(2px);
  background: var(--surface2);
}

/* ── DIVIDER ── */
.divider {
  width: calc(100% - 40px);
  max-width: 400px;
  height: 1px;
  background: var(--border);
  margin: 26px 0 0;
  opacity: 0.4;
}

/* ── HISTORY GRID ── */
.history-section {
  margin-top: 20px;
  width: 100%;
  max-width: 800px;
  padding: 0 20px;
}

.history-title {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 7px;
}

/* ── CELL BASE (not yet drawn: shows shamrock, hides number) ── */
.h-cell {
  height: 100px;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    319deg,
    rgba(0, 217, 0, 1) 40%,
    rgba(0, 255, 0, 0.43) 100%
  );
  border: 1.5px solid var(--border);
  position: relative;
  transition: all 0.25s;
  overflow: hidden;
}

/* Draw-order badge — hidden until drawn */
.h-cell-index {
  display: none;
  position: absolute;
  top: 10px;
  left: 8px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--black);
  line-height: 1;
}

/* Shamrock — visible by default */
.h-cell-shamrock img {
  width: 30px;
}

/* Number — hidden by default, shown when drawn */
.h-cell-number {
  display: none;
  font-size: 3rem;
  font-weight: 600;
  line-height: 1;
  background: linear-gradient(
    339deg,
    rgba(1, 2, 18, 1) 40%,
    rgba(0, 0, 0, 0.74) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  position: absolute;
  top: 58%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* ── CALLED (drawn, not latest) ── */
.h-cell.called {
  background: var(--text);
  border-color: var(--green-dark);
}
.h-cell.called .h-cell-shamrock {
  display: none;
}
.h-cell.called .h-cell-number {
  display: block;
}
.h-cell.called .h-cell-index {
  display: block;
}

/* ── LATEST (most recent draw) ── */
.h-cell.latest {
  background: linear-gradient(160deg, #f5c518 0%, #e6a800 100%);
  color: #3d2800;
  box-shadow:
    0 4px 0 #7a5000,
    0 6px 20px rgba(245, 197, 24, 0.35);
}
.h-cell.latest .h-cell-shamrock {
  display: none;
}
.h-cell.latest .h-cell-number {
  display: block;
}
.h-cell.latest .h-cell-index {
  display: block;
  color: rgba(10, 46, 12, 0.55);
}

/* ── RESPONSIVE ── */
@media (max-width: 767px) {
  .logo {
    width: 100px;
  }
  .ball-number {
    font-size: 5rem;
  }
  .ball {
    width: 156px;
    height: 170px;
  }
  .ball-word {
    font-size: 1rem;
    font-weight: 400;
  }
  .h-cell-number {
    font-size: 2rem;
  }
  .history-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
  }
  .h-cell-index {
    top: 5px;
    left: 5px;
    font-size: 12px;
  }
  .h-cell {
    height: 80px;
  }
}
