/* styles-extra.css  Lotería de Inglés  5x5 Latin lottery style  v19 (LingoLotto colors + tight buttons) */

/* LingoLotto color variables */
:root{
  --bg:#ffffff;
  --bg2:#f3f7ff;
  --text:#0f172a;
  --muted:#475569;

  --brand1:#4f46e5;  /* indigo */
  --brand2:#06b6d4;  /* cyan */

  --green1:#16a34a;
  --green2:#22c55e;

  --gold:#f59e0b;
  --pink:#ec4899;
  --cyan:#06b6d4;

  --line: rgba(15,23,42,0.12);
  --shadow: 0 18px 45px rgba(15,23,42,0.12);
}

/* Page background and general layout */
body{
  margin:0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial;
  background:
    radial-gradient(circle at top, #e8f0ff 0%, var(--bg2) 35%, var(--bg) 100%);
  color: var(--text);
  text-align:center;
}

/* Header (tightened) */
.header{
  padding: 18px 16px 6px 16px;
}

.header h1{
  margin:0;
  font-size: clamp(28px, 5vw, 54px);
  font-weight: 1000;
  color: var(--brand1);
  text-shadow: 0 10px 26px rgba(79,70,229,0.18);
}

.subtitle{
  margin-top: 8px;
  font-size: clamp(14px, 2.5vw, 20px);
  font-style: italic;
  opacity: 0.95;
  color: var(--muted);
  font-weight: 800;
}

.container{
  display:flex;
  flex-direction:column;
  align-items:center;
  padding: 10px 14px 14px 14px;
}

/* Lottery draw area (tight layout so board stays on screen) */
.lottery-mode{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  margin-bottom: 8px;
  width: min(92vw, 560px);
  align-items:center;
  justify-items:center;
}

/* Horizontal row of balls */
.drawn-numbers{
  grid-column: 1 / -1;
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap: 6px;
  margin-top: 2px;
  min-height: 38px;
}

/* Lottery ball look */
.ball{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display:grid;
  place-items:center;
  font-weight: 1000;
  font-size: 18px;
  color: #0b1020;

  background:
    radial-gradient(circle at 30% 30%, #ffffff 0%, #eaf2ff 40%, #a5b4fc 70%, #4f46e5 100%);
  border: 2px solid rgba(79, 70, 229, 0.25);
  box-shadow:
    0 10px 20px rgba(15,23,42,0.18),
    inset 0 3px 6px rgba(255,255,255,0.85);

  animation: ballIn 0.18s ease-out, ballSpin 0.35s ease-out;
  transform-origin:center;
}

@keyframes ballIn{
  0% { transform: scale(0.65); opacity: 0; }
  80% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes ballSpin{
  0% { transform: rotate(0deg); }
  100% { transform: rotate(300deg); }
}

/* Winning squares lighting */
@keyframes litPulse{
  0% { transform: translateY(-1px) scale(1); }
  50% { transform: translateY(-1px) scale(1.02); }
  100% { transform: translateY(-1px) scale(1); }
}

/* Normal winning squares (not completed) */
.square.lit:not(.completed){
  background:#ffffff !important;
  border-color: var(--brand2) !important;
  color:#0b1020 !important;
  box-shadow:
    0 0 0 4px rgba(6,182,212,0.30) inset,
    0 0 18px rgba(6,182,212,0.35),
    0 6px 12px rgba(0,0,0,0.18) !important;
  transform: translateY(-1px);
  animation: litPulse 0.6s ease-in-out;
}

/* Winning squares that are already completed */
.square.lit.completed{
  background: var(--green2) !important;
  border-color: #ffffff !important;
  color:#ffffff !important;
  box-shadow:
    0 0 0 4px rgba(255,255,255,0.85) inset,
    0 0 18px rgba(34,197,94,0.35),
    0 6px 12px rgba(0,0,0,0.18) !important;
  transform: translateY(-1px);
  animation: litPulse 0.6s ease-in-out;
}

/* Ticket frame */
.board{
  width: min(92vw, 560px);
  aspect-ratio: 1 / 1;
  background: rgba(255,255,255,0.65);
  border-radius: 18px;
  padding: 8px;
  box-shadow: var(--shadow);
  display:grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  position:relative;
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

/* Each square base */
.square{
  position:relative;
  display:flex;
  flex-direction:column;
  justify-content:center;
  background:#ffffff;
  color:#0b1020;
  border: 3px solid rgba(15,23,42,0.12);
  border-radius: 10px;
  padding: 6px 6px 8px 6px;
  cursor:pointer;
  font-weight: 900;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  overflow:hidden;
}

.square:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(15,23,42,0.12);
}

/* Theme colors (lively like LingoLotto) */
.square.theme-1{
  background: linear-gradient(180deg, #ffffff 0%, rgba(96,165,250,0.22) 100%);
  border-color: rgba(79,70,229,0.28);
}
.square.theme-2{
  background: linear-gradient(180deg, #ffffff 0%, rgba(236,72,153,0.18) 100%);
  border-color: rgba(236,72,153,0.35);
}
.square.theme-3{
  background: linear-gradient(180deg, #ffffff 0%, rgba(34,197,94,0.18) 100%);
  border-color: rgba(34,197,94,0.35);
}
.square.theme-4{
  background: linear-gradient(180deg, #ffffff 0%, rgba(6,182,212,0.18) 100%);
  border-color: rgba(6,182,212,0.35);
}
.square.theme-5{
  background: linear-gradient(180deg, #ffffff 0%, rgba(245,158,11,0.18) 100%);
  border-color: rgba(245,158,11,0.35);
}

/* Completed squares */
.square.completed{
  background: var(--green2) !important;
  border-color: var(--green1) !important;
  color:#ffffff !important;
}

.square.selected{
  outline: 3px solid rgba(79,70,229,0.55);
  outline-offset: 2px;
}

/* Lesson icon area (optional) */
.lesson-icon{
  display:grid;
  place-items:center;
  margin-bottom: 4px;
  height: 28px;
}

.lesson-icon img{
  max-width: 26px;
  max-height: 26px;
  object-fit: contain;
}

.lesson-icon.emoji{
  font-size: 22px;
  line-height:1;
}

/* Lesson number big on top */
.lesson-id{
  font-size: clamp(18px, 3.2vw, 26px);
  font-weight: 1000;
  margin-bottom: 6px;
}

/* English text inside square */
.lesson-en{
  font-size: clamp(10px, 2.1vw, 13px);
  font-weight: 900;
  line-height: 1.15;
  max-height: 3.5em;
  overflow:hidden;
  text-overflow: ellipsis;
  color: rgba(15,23,42,0.72);
}

/* Checkmark overlay */
.checkmark{
  position:absolute;
  top: 6px;
  left: 6px;
  font-size: 22px;
  font-weight: 1000;
  color:#ffffff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.35);
}

/* Tap and stamp animations */
.square.tap-pop{
  animation: tapPop 0.18s ease;
}
.square.stamp-pop{
  animation: stampPop 0.35s ease;
}

@keyframes tapPop{
  0% { transform: scale(1); }
  60% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@keyframes stampPop{
  0% { transform: scale(1); box-shadow: none; }
  50% { transform: scale(1.06); box-shadow: 0 0 0 6px rgba(79,70,229,0.18) inset; }
  100% { transform: scale(1); box-shadow: none; }
}

/* Buttons */
.reset-btn{
  margin: 0;
  background: linear-gradient(135deg, var(--brand1), #60a5fa);
  border:none;
  color:#fff;
  padding: 10px 14px;
  font-size: 14px;
  border-radius: 12px;
  cursor:pointer;
  font-weight: 1000;
  box-shadow: 0 12px 26px rgba(79,70,229,0.20);
}

.reset-btn:hover{
  filter: brightness(1.03);
}

/* Modal */
.modal{
  position:fixed;
  inset:0;
  background: rgba(15,23,42,0.55);
  display:none;
  align-items:center;
  justify-content:center;
  padding: 14px;
  z-index:9999;
}

.modal.open{
  display:flex;
}

.modal-content{
  width: min(92vw, 520px);
  background:#fff;
  color: var(--text);
  padding: 18px;
  border-radius: 18px;
  text-align:left;
  position:relative;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.modal-content h2{
  margin-top:0;
  color: var(--brand1);
  font-weight: 1000;
}

.close-btn{
  position:absolute;
  top: 10px;
  right: 12px;
  font-weight: 1000;
  cursor:pointer;
  color: var(--brand1);
}

.lines .line{
  padding: 8px 0;
  border-bottom: 1px solid rgba(15,23,42,0.10);
}

.lines .speaker{
  font-weight: 1000;
  margin-bottom: 2px;
  color: rgba(15,23,42,0.70);
}

.lines .en{
  font-size: 16px;
  font-weight: 1000;
}

.lines .pron{
  font-size: 13px;
  opacity: 0.7;
  margin-top: 2px;
}

.lines .sp{
  font-size: 14px;
  margin-top: 4px;
  font-weight: 900;
  color: rgba(15,23,42,0.78);
}

/* Footer */
.footer{
  font-size: 12px;
  opacity: 0.95;
  padding: 18px 14px 28px 14px;
  max-width: 700px;
  margin: 0 auto;
  color: var(--muted);
  font-weight: 900;
}

/* Tiny phones */
@media (max-width: 420px){
  .board{
    gap: 6px;
    padding: 8px;
  }
  .square{
    padding: 5px;
  }
  .lesson-icon{
    height: 22px;
  }
  .ball{
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  /* tighten buttons on tiny screens */
  .lottery-mode{
    gap: 8px;
  }
  .reset-btn{
    padding: 9px 10px;
    font-size: 13px;
    border-radius: 12px;
  }
}
