/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --pink: #f8a4c8;
  --pink-dark: #e879a8;
  --gold: #f5c842;
  --gold-dark: #d4a017;
  --purple: #7b4fbe;
  --purple-dark: #5a358f;
  --bg: #1a0a2e;
  --bg-card: #2d1b4e;
  --text: #fff8f0;
  --text-muted: #c9b8d9;
  --shitty: #ff6b6b;
  --good: #69db7c;
  --real: #ffd43b;
  --shadow: 0 8px 32px rgba(0,0,0,.45);
  --radius: 16px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Nunito', system-ui, sans-serif;
}

html { font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(248,164,200,.18) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 100%, rgba(123,79,190,.22) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 50%, rgba(245,200,66,.06) 0%, transparent 70%);
}

/* ── Screens ────────────────────────────────────────────────── */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
  padding: 1.25rem;
  animation: fadeIn .5s ease;
}

.screen.active { display: flex; }

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

/* ── Welcome ────────────────────────────────────────────────── */
.welcome-card {
  max-width: 520px;
  text-align: center;
  margin: auto;
  padding: 2.5rem 2rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 2px solid rgba(245,200,66,.35);
  box-shadow: var(--shadow);
}

.welcome-emoji { font-size: 3.5rem; margin-bottom: .75rem; }

.welcome-card h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  color: var(--gold);
  margin-bottom: .5rem;
  line-height: 1.25;
}

.welcome-card .subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.rules {
  text-align: left;
  background: rgba(0,0,0,.25);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
  font-size: .92rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.rules li { margin-left: 1.1rem; margin-bottom: .35rem; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .85rem 2rem;
  border: none;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, filter .15s;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.btn:hover  { transform: translateY(-2px); filter: brightness(1.08); }
.btn:active { transform: translateY(0); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #3d2a00;
  box-shadow: 0 4px 20px rgba(245,200,66,.4);
}

.btn-deal {
  background: linear-gradient(135deg, #51cf66, #2f9e44);
  color: #fff;
  box-shadow: 0 4px 20px rgba(81,207,102,.4);
  flex: 1;
}

.btn-nodeal {
  background: linear-gradient(135deg, #ff6b6b, #c92a2a);
  color: #fff;
  box-shadow: 0 4px 20px rgba(255,107,107,.4);
  flex: 1;
}

.btn-swap {
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  color: #fff;
  box-shadow: 0 4px 20px rgba(123,79,190,.4);
}

/* ── Game header ────────────────────────────────────────────── */
.game-header {
  width: 100%;
  max-width: 1100px;
  text-align: center;
  margin-bottom: 1rem;
}

.game-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3.5vw, 1.6rem);
  color: var(--gold);
}

.phase-hint {
  font-size: .88rem;
  color: var(--text-muted);
  margin-top: .35rem;
}

.round-counter {
  display: inline-block;
  background: rgba(245,200,66,.15);
  border: 1px solid rgba(245,200,66,.3);
  border-radius: 20px;
  padding: .2rem .85rem;
  font-size: .8rem;
  color: var(--gold);
  margin-top: .5rem;
}

/* ── Game layout ────────────────────────────────────────────── */
.game-layout {
  display: grid;
  grid-template-columns: 160px 1fr 160px;
  gap: 1rem;
  width: 100%;
  max-width: 1100px;
  flex: 1;
  align-items: start;
}

@media (max-width: 800px) {
  .game-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }
  .prize-board { max-height: 120px; overflow-y: auto; }
}

/* ── Prize boards ───────────────────────────────────────────── */
.prize-board {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.08);
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.prize-board h3 {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: .25rem;
}

.prize-item {
  font-size: .78rem;
  padding: .3rem .5rem;
  border-radius: 8px;
  background: rgba(255,255,255,.05);
  transition: opacity .4s, transform .4s;
  line-height: 1.3;
  word-break: break-word;
}

.prize-item.shitty { border-left: 3px solid var(--shitty); }
.prize-item.good   { border-left: 3px solid var(--good); }
.prize-item.real   { border-left: 3px solid var(--real); font-weight: 700; }

.prize-item.revealed {
  opacity: .35;
  text-decoration: line-through;
  text-decoration-color: rgba(255,255,255,.5);
  transform: scale(.97);
}

/* ── Box grid ───────────────────────────────────────────────── */
.box-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.box-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .75rem;
  width: 100%;
  max-width: 480px;
}

@media (max-width: 400px) {
  .box-grid { grid-template-columns: repeat(4, 1fr); }
}

.box {
  aspect-ratio: 1;
  background: linear-gradient(145deg, #c9956a, #8b5e3c);
  border-radius: 12px;
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: clamp(1rem, 3vw, 1.4rem);
  font-weight: 700;
  color: var(--gold);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.15);
  transition: transform .2s, box-shadow .2s, opacity .3s;
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.box::before {
  content: '🎀';
  position: absolute;
  top: -6px;
  font-size: .85rem;
}

.box:not(.disabled):not(.opened):not(.mine):hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 24px rgba(245,200,66,.35);
}

.box.mine {
  cursor: default;
  background: linear-gradient(145deg, var(--pink), var(--pink-dark));
  border-color: #fff;
  color: #fff;
  box-shadow: 0 0 20px rgba(248,164,200,.5);
}

.box.opened {
  cursor: default;
  opacity: .5;
  background: #3d2a1a;
  border-color: #666;
  color: #888;
  transform: scale(.92);
}

.box.opened .box-prize {
  font-size: .55rem;
  color: var(--text-muted);
  text-align: center;
  padding: .2rem;
  line-height: 1.2;
  font-family: var(--font-body);
  font-weight: 400;
}

.box.suspense {
  animation: shake .15s infinite alternate;
  pointer-events: none;
}

@keyframes shake {
  from { transform: rotate(-3deg) scale(1.05); }
  to   { transform: rotate(3deg) scale(1.05); }
}

.box.reveal-pop {
  animation: popReveal .5s ease forwards;
}

@keyframes popReveal {
  0%   { transform: scale(1.1); }
  50%  { transform: scale(1.2); box-shadow: 0 0 30px var(--gold); }
  100% { transform: scale(.92); opacity: .5; }
}

.box.disabled {
  cursor: not-allowed;
  opacity: .6;
}

/* ── My box corner ──────────────────────────────────────────── */
.my-box-corner {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  background: linear-gradient(145deg, var(--pink), var(--pink-dark));
  border: 2px solid #fff;
  border-radius: var(--radius);
  padding: .75rem 1rem;
  box-shadow: var(--shadow);
  display: none;
  align-items: center;
  gap: .75rem;
  z-index: 50;
  animation: slideInLeft .5s ease;
}

.my-box-corner.visible { display: flex; }

@keyframes slideInLeft {
  from { transform: translateX(-80px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

.my-box-corner .corner-label {
  font-size: .75rem;
  color: rgba(255,255,255,.8);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.my-box-corner .corner-number {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  width: 48px;
  height: 48px;
  background: rgba(0,0,0,.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Modal (Banker) ─────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn .3s ease;
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg-card);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 60px rgba(245,200,66,.2);
  animation: modalPop .4s cubic-bezier(.34,1.56,.64,1);
}

@keyframes modalPop {
  from { transform: scale(.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.modal .phone-icon {
  font-size: 3rem;
  animation: ring 1s ease infinite;
  display: block;
  margin-bottom: .75rem;
}

@keyframes ring {
  0%, 100% { transform: rotate(-8deg); }
  50%       { transform: rotate(8deg); }
}

.modal h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--gold);
  margin-bottom: .75rem;
}

.modal p {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-size: .95rem;
}

.modal-offer {
  font-size: 1.1rem;
  color: var(--text);
  font-weight: 700;
  background: rgba(245,200,66,.12);
  border-radius: 10px;
  padding: .75rem 1rem;
  margin-bottom: 1.5rem;
}

.modal-buttons {
  display: flex;
  gap: .75rem;
}

/* ── Final / Reveal screens ─────────────────────────────────── */
.final-card, .reveal-card {
  max-width: 520px;
  text-align: center;
  margin: auto;
  padding: 2.5rem 2rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 2px solid rgba(245,200,66,.35);
  box-shadow: var(--shadow);
}

.final-card h2, .reveal-card h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  color: var(--gold);
  margin-bottom: 1rem;
}

.final-card p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.final-buttons {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.reveal-prize {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-family: var(--font-display);
  color: var(--gold);
  margin: 1rem 0;
  animation: prizeGlow 2s ease infinite alternate;
}

@keyframes prizeGlow {
  from { text-shadow: 0 0 10px rgba(245,200,66,.3); }
  to   { text-shadow: 0 0 30px rgba(245,200,66,.7); }
}

.reveal-desc {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: .5rem;
}

.reveal-emoji { font-size: 4rem; margin: 1rem 0; }

.deal-note {
  margin-top: 1.25rem;
  font-size: .85rem;
  color: var(--pink);
  font-style: italic;
}

/* ── Toast for opened prize ─────────────────────────────────── */
.prize-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: var(--bg-card);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 1.25rem 2rem;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  z-index: 200;
  pointer-events: none;
  box-shadow: 0 0 40px rgba(245,200,66,.3);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .3s;
  opacity: 0;
  max-width: 90vw;
}

.prize-toast.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.prize-toast.hide {
  transform: translate(-50%, -50%) scale(.8);
  opacity: 0;
}

/* ====================== PROFESSIONAL MOBILE-FIRST OVERHAUL ====================== */
/* Nova romantična, sodobna, visoko kontrastna paleta + mobile-first pravila */

:root {
  --bg-start: #2a1b4a;
  --bg-end: #1a0f2e;
  --accent-pink: #ff9ed3;
  --accent-gold: #f4d35e;
  --accent-purple: #c79fff;
  --text-primary: #f8f1e9;
  --text-muted: #d4c2e8;
  --card-bg: rgba(42, 27, 74, 0.85);
  --card-border: rgba(244, 211, 94, 0.25);
  --success: #7cff9e;
  --danger: #ff6b6b;
  --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.3);
  --radius: 20px;
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
  color: var(--text-primary);
  font-size: 16px; /* base za mobile */
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}

/* Mobile-first global improvements */
.screen {
  padding: 20px 16px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.btn {
  min-height: 56px; /* veliki touch target */
  font-size: 1.1rem;
  border-radius: 9999px;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
}

.btn:active {
  transform: scale(0.95);
}

/* Box grid - auto responsive */
.box-grid {
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr)) !important;
  gap: 14px;
  max-width: 100%;
}

.box {
  aspect-ratio: 1 / 1;
  min-height: 74px;
  font-size: 1.35rem;
  border-radius: 16px;
}

/* Prize boards on mobile */
.prize-board {
  max-height: none;
  padding: 12px;
  border-radius: var(--radius);
}

.prize-item {
  padding: 10px 12px;
  font-size: 0.95rem;
  border-radius: 12px;
}

/* Modals on mobile */
.modal {
  margin: 20px;
  max-width: none;
  width: calc(100% - 40px);
  border-radius: 24px;
}

/* My box corner - always visible and prominent on mobile */
.my-box-corner {
  bottom: 16px;
  left: 16px;
  right: 16px;
  width: auto;
  border-radius: 16px;
  padding: 12px 16px;
}

/* High contrast text fixes */
.phase-hint, .rules li, .modal p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Improved welcome card on mobile */
.welcome-card {
  padding: 32px 24px;
  border-radius: 28px;
}

.welcome-card h1 {
  font-size: 2.1rem;
}

.rules {
  padding: 20px;
  font-size: 1rem;
}

/* Banker modal improvements */
.modal-offer {
  font-size: 1.15rem;
  padding: 20px;
  border-radius: 16px;
}

/* Reveal screen big images */
.reveal-prize img, .reveal-card img {
  max-width: 100%;
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
}

/* Final polish */
.prize-toast {
  font-size: 1.25rem;
  padding: 20px 28px;
  border-radius: 20px;
}
