/* ================================================================
   RhyLift Seilbahn-Game – game.css
   Colors from rhylift.ch:  primary #0B4FA8 | eco #2daf65 | warning #f5a623
   Bootstrap 5 compatible – custom classes prefixed with -rl or game-
   ================================================================ */

/* ── CSS Variables (mirrors rhylift.ch) ─────────────────────────── */


/* ── Base ────────────────────────────────────────────────────────── */

/* ── Layout ──────────────────────────────────────────────────────── */
.game-section  { display: flex; justify-content: center; padding: 0 0 24px; overflow-x: hidden; }
.game-container {
  width: 100%;
  max-width: 920px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Header bar ─────────────────────────────────────────────────── */
.game-header {
  background: var(--dark);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-sm);
}
.game-logo-icon { font-size: 1.5rem; line-height: 1; }
.game-logo-text { font-size: 1.2rem; font-weight: 800; color: #fff; letter-spacing: .03em; }
.game-logo-sub  { font-size: .8rem;  color: rgba(255,255,255,.55); }

/* ── HUD ─────────────────────────────────────────────────────────── */
.game-hud {
  background: var(--dark-2);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.hud-level    { font-size: .9rem; font-weight: 700; line-height: 1.2; }
.hud-sublabel { font-size: .72rem; color: rgba(255,255,255,.55); }
.hud-score-label { font-size: .65rem; color: rgba(255,255,255,.55); text-transform: uppercase; letter-spacing: .06em; }
.hud-score    { font-size: 1.55rem; font-weight: 800; color: var(--warning); line-height: 1; }
.hud-progress {
  height: 7px;
  border-radius: 4px;
  background: rgba(255,255,255,.15);
  overflow: visible;
}
.hud-progress .progress-bar { transition: width .4s ease, background-color .4s ease; border-radius: 4px; }

/* CO2 badge */
.co2-badge {
  display: flex; align-items: center; gap: 4px;
  background: var(--eco-bg); color: var(--eco-dark);
  border: 1px solid rgba(45,175,101,.3);
  border-radius: 20px; padding: 3px 9px;
  font-size: .78rem; font-weight: 700;
  white-space: nowrap;
}
.text-eco { color: var(--eco) !important; }
.text-primary-rl { color: var(--primary) !important; }

/* Queue strip */
.hud-strip {
  background: rgba(0,0,0,.18);
  font-size: .78rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.hud-queue strong { color: var(--warning); }
.hud-queue.critical strong { color: #ff6b6b !important; }
.hud-gondolas { font-weight: 600; color: rgba(255,255,255,.8); }

/* ── Canvas ──────────────────────────────────────────────────────── */
.canvas-wrapper {
  background: #1a3a5c;
  position: relative;
  line-height: 0;
  touch-action: none;
  overflow: hidden;  /* prevent canvas bleed on mobile */
}
.canvas-wrapper canvas {
  display: block;
  width: 100% !important;
  height: auto !important;
  cursor: default;
}

/* ── Controls ────────────────────────────────────────────────────── */
.game-controls {
}

/* ── Level dots ──────────────────────────────────────────────────── */
.level-dots {  }
.lvl-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #dde6ef; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700; cursor: default;
  transition: all var(--trans);
}
.lvl-dot.active   { background: var(--primary); color: #fff; transform: scale(1.18); box-shadow: 0 2px 10px rgba(11,79,168,.4); }
.lvl-dot.complete { background: var(--eco);     color: #fff; }

/* ── Custom Buttons ──────────────────────────────────────────────── */
.btn-primary-rl {
  background: var(--primary); color: #fff; border: none;
  border-radius: 50px; font-weight: 700; padding: 9px 22px;
  box-shadow: 0 3px 14px rgba(11,79,168,.35);
  transition: all var(--trans);
}
.btn-primary-rl:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-1px); color: #fff; box-shadow: 0 6px 20px rgba(11,79,168,.45); }
.btn-primary-rl:disabled { opacity: .42; cursor: not-allowed; }

.btn-secondary-rl {
  background: var(--dark-2); color: #fff; border: none;
  border-radius: 50px; font-weight: 600; padding: 9px 22px;
  transition: all var(--trans);
}
.btn-secondary-rl:hover:not(:disabled) { background: var(--dark); color: #fff; }
.btn-secondary-rl:disabled { opacity: .42; cursor: not-allowed; }

.btn-outline-rl {
  background: transparent; color: var(--primary);
  border: 2px solid var(--primary); border-radius: 50px;
  font-weight: 600; padding: 8px 20px;
  transition: all var(--trans);
}
.btn-outline-rl:hover { background: var(--primary-bg); color: var(--primary); }

.btn-deploy { font-size: .95rem; }

/* Mobile: bigger touch targets */
@media (max-width: 576px) {
  .btn-primary-rl, .btn-secondary-rl, .btn-outline-rl { padding: 11px 20px; font-size: .9rem; }
  .btn-deploy { padding: 13px 24px; font-size: 1rem; }
}

/* Share buttons */
.btn-share {
  padding: 7px 14px; border-radius: 20px; font-size: .82rem;
  font-weight: 600; border: none; color: #fff; cursor: pointer;
  transition: all var(--trans);
}
.btn-share:hover { opacity: .88; transform: translateY(-1px); }
.btn-wa   { background: #25D366; }
.btn-fb   { background: #1877F2; }
.btn-tw   { background: #000; }
.btn-copy { background: var(--muted); }

/* ── Modals ──────────────────────────────────────────────────────── */
.game-modal {
  border: none; border-radius: var(--radius-lg) !important;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.28) !important;
}
.modal-success { border-top: 5px solid var(--eco) !important; }
.modal-danger  { border-top: 5px solid var(--secondary) !important; }
.modal-win     { border-top: 5px solid var(--warning) !important; }

.modal-emoji { font-size: 3rem; line-height: 1; margin-bottom: 6px; }

.how-to-list { display: flex; flex-direction: column; gap: 8px; }
.how-to-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 10px; background: var(--dark-2); border-radius: 8px;
  font-size: .88rem;
}
.how-to-item span:first-child { font-size: 1.1rem; flex-shrink: 0; }

.alert-primary-rl {
  background: var(--primary-bg); border: 1px solid rgba(11,79,168,.2);
  color: var(--dark); border-radius: var(--radius); font-size: .9rem;
}

/* Stats */
.stat-row { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.stat-box  { text-align: center; min-width: 70px; }
.stat-val  { font-size: 1.8rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-lbl  { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.stat-highlight .stat-val { font-size: 2.1rem; color: var(--warning-dark); }

/* Score form card */
.score-form-card {
  background: var(--primary-bg); border-radius: var(--radius);
  padding: 16px; margin-top: 4px; text-align: left;
  border: 1px solid rgba(11,79,168,.15);
}
.score-form-card .form-control { border-color: rgba(11,79,168,.2); font-size: .9rem; }
.score-form-card .form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(11,79,168,.15); }
.score-form-card a { color: var(--primary); }

.form-msg {
  padding: 8px 12px; border-radius: 8px; font-size: .85rem;
  display: none; text-align: center;
}
.form-msg.success { background: var(--eco-bg); color: var(--eco-dark); display: block; }
.form-msg.error   { background: #fde8e8; color: #c0392b; display: block; }

/* Leaderboard */
.table-leaderboard { font-size: .85rem; }
.table-leaderboard th { background: var(--primary); color: #fff; font-size: .78rem; border: none; }
.table-leaderboard td { vertical-align: middle; border-color: var(--border); }
.table-leaderboard tbody tr:first-child td { font-weight: 700; color: #c07800; background: #fff8e6; }
.table-leaderboard tbody tr:nth-child(2) td { font-weight: 600; }
.table-leaderboard tbody tr:nth-child(3) td { color: #7a5a3a; font-weight: 600; }

/* ── Animations ──────────────────────────────────────────────────── */
@keyframes scorePop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.3); color: #fff; }
  100% { transform: scale(1); }
}
.score-pop { animation: scorePop .32s ease; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .5; }
}
.pulse { animation: pulse .75s ease-in-out infinite; }

@keyframes unlockFlash {
  0%   { background: var(--primary); box-shadow: 0 0 0 0 rgba(0,102,204,.7); }
  40%  { background: #f5a623;        box-shadow: 0 0 0 8px rgba(245,166,35,.3); }
  70%  { background: var(--primary); box-shadow: 0 0 0 4px rgba(0,102,204,.15); }
  100% { background: var(--primary); box-shadow: none; }
}
.unlock-flash { animation: unlockFlash 1.6s ease forwards; }



/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 576px) {
  .game-logo-text { font-size: 1rem; }
  .hud-score { font-size: 1.3rem; }
  .stat-val  { font-size: 1.5rem; }
  .stat-highlight .stat-val { font-size: 1.8rem; }
  .modal-emoji { font-size: 2.5rem; }
  .game-modal { border-radius: var(--radius) !important; }
  .co2-badge { display: none; } /* shown in game canvas instead */
  .hud-strip { font-size: .72rem; }
}

@media (max-width: 380px) {
  .stat-row { gap: 10px; }
  .btn-share { padding: 6px 10px; font-size: .78rem; }
}
