/* ============ EL CODI · Estètica caixa forta ============ */
:root {
  --bg-1: #0b0f17;
  --bg-2: #131a26;
  --panel: #1b2433;
  --panel-2: #232e42;
  --steel-1: #3a4458;
  --steel-2: #2a3346;
  --steel-3: #1a2332;
  --gold: #f5c451;
  --gold-2: #c79a2e;
  --led-red: #ff3b3b;
  --led-green: #28e07a;
  --led-amber: #ffb020;
  --text: #e8eef7;
  --muted: #8c9bb3;
  --accent: #ff5b5b;
  --ok: #28e07a;
  --bad: #ff5b5b;
  --shadow-deep: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1200px 600px at 50% -10%, #1f2a3d 0%, transparent 60%),
    radial-gradient(800px 400px at 100% 100%, #1a1530 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 24px 14px 40px;
}

.container {
  width: 100%;
  max-width: 480px;
}

/* ===== TOP BAR ===== */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; gap: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(145deg, var(--steel-1), var(--steel-3));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 4px 10px rgba(0,0,0,0.4);
}
h1 {
  font-family: "Orbitron", sans-serif;
  font-weight: 900; font-size: 26px; margin: 0; letter-spacing: 1px;
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.top-right { display: flex; align-items: center; gap: 10px; }

/* Selector idioma */
.lang-switch {
  display: flex; gap: 2px; padding: 3px; border-radius: 10px;
  background: var(--panel);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.4);
}
.lang-btn {
  border: none; background: transparent; color: var(--text);
  font-family: "Orbitron", sans-serif;
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  min-width: 34px; height: 28px; padding: 0 8px;
  border-radius: 7px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1; transition: background .2s, color .2s, transform .1s;
}
.lang-btn:hover { background: var(--panel-2); }
.lang-btn.active {
  background: linear-gradient(145deg, var(--gold), var(--gold-2));
  color: #1a1206;
  box-shadow: 0 2px 6px rgba(245,196,81,0.3);
}

.xp-pill {
  background: linear-gradient(145deg, var(--steel-1), var(--steel-3));
  padding: 7px 13px; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: var(--gold);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 3px 8px rgba(0,0,0,0.4);
  font-family: "Orbitron", sans-serif; letter-spacing: 0.5px;
}

/* ===== INSTRUCCIONS ===== */
.instructions {
  font-size: 14px; color: var(--muted); line-height: 1.5;
  margin: 6px 0 18px; text-align: center;
}

/* ===== CAIXA FORTA ===== */
.safe {
  position: relative;
  background:
    linear-gradient(145deg, #2a3346 0%, #1a2332 50%, #131a26 100%);
  border-radius: 22px;
  padding: 22px 22px 28px;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.06),
    inset 0 -2px 12px rgba(0,0,0,0.6),
    var(--shadow-deep);
  border: 1px solid rgba(255,255,255,0.04);
  overflow: hidden;
}
/* Reblons decoratius */
.safe::before, .safe::after {
  content: ""; position: absolute; width: 8px; height: 8px;
  border-radius: 50%; top: 10px;
  background: radial-gradient(circle at 30% 30%, #6a7589, #2a3346);
  box-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
.safe::before { left: 10px; }
.safe::after  { right: 10px; }

/* Pantalla LED */
.safe-display {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(180deg, #050a12, #0a1320);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 22px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.7), 0 1px 0 rgba(255,255,255,0.05);
  border: 1px solid #000;
  font-family: "Orbitron", sans-serif;
}
.led {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--led-red);
  box-shadow: 0 0 10px var(--led-red), 0 0 4px var(--led-red);
  animation: blink 1.5s infinite;
}
.led.green { background: var(--led-green); box-shadow: 0 0 12px var(--led-green), 0 0 4px var(--led-green); animation: none; }
.led.amber { background: var(--led-amber); box-shadow: 0 0 12px var(--led-amber), 0 0 4px var(--led-amber); }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.display-text { display: flex; flex-direction: column; flex: 1; line-height: 1.2; }
.display-label { color: #4a5b75; font-size: 10px; letter-spacing: 2px; }
.display-value {
  color: var(--led-red); font-size: 18px; font-weight: 700;
  letter-spacing: 2px; text-shadow: 0 0 6px currentColor;
}
.display-value.green { color: var(--led-green); }
.display-value.amber { color: var(--led-amber); }

.display-attempts {
  display: flex; flex-direction: column; align-items: flex-end;
  color: #4a5b75; font-size: 10px; letter-spacing: 2px;
}
.display-attempts span:last-child {
  color: var(--led-amber); font-size: 18px; font-weight: 700;
  text-shadow: 0 0 6px currentColor;
}

/* Teclat */
.keypad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.keypad-9 {
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}
.keypad-9 .key { height: 78px; }
.keypad-9 .key-num { font-size: 28px; }
.key {
  position: relative;
  height: 64px;
  border: none; cursor: pointer;
  border-radius: 14px;
  background:
    linear-gradient(145deg, #4a5670 0%, #2c3548 100%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.18),
    inset 0 -3px 0 rgba(0,0,0,0.4),
    0 4px 0 #1a2030,
    0 6px 12px rgba(0,0,0,0.5);
  transition: transform .08s, box-shadow .08s, background .25s;
  overflow: hidden;
}
.key::before {
  content: ""; position: absolute; inset: 4px;
  border-radius: 10px;
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,0.12), transparent 60%);
  pointer-events: none;
}
.key-num {
  font-family: "Orbitron", sans-serif;
  font-size: 22px; font-weight: 700;
  color: #e8eef7;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
  position: relative; z-index: 1;
}
.key:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.22),
    inset 0 -3px 0 rgba(0,0,0,0.4),
    0 5px 0 #1a2030,
    0 8px 16px rgba(0,0,0,0.55);
}
.key:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.4),
    0 1px 0 #1a2030;
}
.key.correct {
  background: linear-gradient(145deg, #3ee887 0%, #1a8f4e 100%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.3),
    inset 0 -3px 0 rgba(0,0,0,0.3),
    0 4px 0 #0d5530,
    0 0 24px rgba(40,224,122,0.5);
}
.key.incorrect {
  background: linear-gradient(145deg, #ff7676 0%, #a82020 100%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.3),
    inset 0 -3px 0 rgba(0,0,0,0.3),
    0 4px 0 #5a0d0d,
    0 0 24px rgba(255,91,91,0.5);
  animation: shake .35s;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
.key:disabled { cursor: not-allowed; opacity: 0.85; }

/* Punts de progrés */
.progress-dots {
  display: flex; justify-content: center; gap: 10px;
  margin-bottom: 16px;
}
.dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: #1a2030;
  box-shadow: inset 0 2px 3px rgba(0,0,0,0.6);
  transition: all .2s;
}
.dot.on {
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold), inset 0 1px 0 rgba(255,255,255,0.3);
}
.dot.err { background: var(--bad); box-shadow: 0 0 10px var(--bad); }

/* Manilla decorativa */
.safe-handle {
  position: relative; width: 70px; height: 70px;
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #6a7589, #2a3346 60%, #131a26);
  box-shadow:
    inset 0 3px 8px rgba(255,255,255,0.1),
    inset 0 -3px 8px rgba(0,0,0,0.6),
    0 6px 14px rgba(0,0,0,0.5);
  display: grid; place-items: center;
  transition: transform 1.2s ease;
}
.safe.unlocked .safe-handle { transform: rotate(135deg); }
.handle-spoke {
  position: absolute; width: 6px; height: 80px;
  background: linear-gradient(180deg, #6a7589, #2a3346);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}
.handle-spoke:nth-child(1) { transform: rotate(0deg); }
.handle-spoke:nth-child(2) { transform: rotate(45deg); }
.handle-spoke:nth-child(3) { transform: rotate(90deg); }
.handle-spoke:nth-child(4) { transform: rotate(135deg); }

/* ===== MISSATGE ===== */
.message {
  min-height: 28px; margin: 18px 0 6px; text-align: center;
  font-weight: 600; font-size: 15px;
  transition: opacity .3s;
}
.message.win {
  font-size: 17px;
  background: linear-gradient(90deg, var(--gold), #fff3c4, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.help {
  text-align: center; font-size: 12px; color: var(--muted);
  margin: 8px 0 18px; line-height: 1.5;
}

/* ===== RÀNQUING ===== */
.ranking {
  background: linear-gradient(145deg, var(--panel), var(--panel-2));
  padding: 16px 18px;
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 6px 14px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.04);
}
.ranking h2 {
  margin: 0 0 12px; font-size: 16px;
  font-family: "Orbitron", sans-serif; letter-spacing: 0.5px;
}
#ranking-list { list-style: none; padding: 0; margin: 0; }
#ranking-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 14px;
}
#ranking-list li:last-child { border-bottom: none; }
#ranking-list li .name { font-weight: 600; }
#ranking-list li .pos { color: var(--gold); font-weight: 700; margin-right: 8px; font-family: "Orbitron", sans-serif; }
#ranking-list li .score { color: var(--muted); font-size: 13px; }
.ranking-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 12px 0; }

.foot { text-align: center; color: var(--muted); font-size: 11px; margin-top: 16px; }

/* ===== MODAL ===== */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  padding: 16px; animation: fadeIn .2s;
}
.modal.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: linear-gradient(145deg, var(--panel-2), var(--panel));
  padding: 26px 24px; border-radius: 18px;
  width: 100%; max-width: 380px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.06);
  text-align: center;
}
.modal-icon { font-size: 48px; margin-bottom: 8px; }
.modal-box h3 {
  margin: 0 0 8px; font-family: "Orbitron", sans-serif;
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.modal-box p { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.modal-box input {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid #2a3346; background: #0e141f; color: var(--text);
  font-size: 16px; margin-bottom: 8px;
  outline: none; transition: border .2s;
}
.modal-box input:focus { border-color: var(--gold); }
.error { color: #ff7676; min-height: 18px; font-size: 13px; margin-bottom: 8px; }
.modal-actions { display: flex; gap: 10px; }
.btn-primary, .btn-secondary {
  flex: 1; padding: 12px; border: none; border-radius: 10px;
  font-weight: 700; font-size: 14px; cursor: pointer;
  transition: transform .08s, filter .2s;
}
.btn-primary {
  background: linear-gradient(145deg, var(--gold), var(--gold-2));
  color: #1a1a1a;
}
.btn-secondary {
  background: var(--panel); color: var(--text);
  border: 1px solid rgba(255,255,255,0.08);
}
.btn-primary:hover, .btn-secondary:hover { transform: translateY(-1px); filter: brightness(1.1); }
.btn-primary:active, .btn-secondary:active { transform: translateY(1px); }

/* Mòbil */
@media (max-width: 420px) {
  .key { height: 56px; }
  .key-num { font-size: 18px; }
  h1 { font-size: 22px; }
  .lang-btn { font-size: 16px; padding: 4px 6px; }
}

/* ===== COMPARTIR ===== */
.share-box {
  margin: 18px auto 0; max-width: 480px;
  padding: 16px 18px; border-radius: 14px;
  background: linear-gradient(145deg, var(--panel), var(--panel-2));
  box-shadow: 0 6px 18px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.05);
  text-align: center;
  animation: fadeInUp .35s ease-out;
}
.share-box.hidden { display: none; }
.share-title {
  margin: 0 0 12px; color: var(--gold);
  font-family: "Orbitron", sans-serif; font-weight: 700; letter-spacing: 0.5px;
  font-size: 14px;
}
.share-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn-share {
  border: none; cursor: pointer;
  padding: 10px 16px; border-radius: 10px;
  font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-share:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn-share:active { transform: translateY(0); }
.btn-wa { background: linear-gradient(145deg, #25d366, #128c7e); color: #fff; }
.btn-copy { background: linear-gradient(145deg, var(--steel-1), var(--steel-3)); color: var(--gold); }
.share-feedback { min-height: 18px; margin: 8px 0 0; font-size: 13px; color: var(--led-green); font-weight: 600; }

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

/* Destacar la teva fila al rànquing */
.rank-row.mine {
  background: linear-gradient(90deg, rgba(245,196,81,0.18), transparent);
  border-left: 3px solid var(--gold);
  padding-left: 8px;
}

/* ===== KEYS PILL ===== */
.keys-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(145deg, #2a2418, #1a1610);
  color: var(--gold);
  padding: 6px 12px; border-radius: 999px;
  font-weight: 700; font-size: 13px;
  border: 1px solid rgba(245,196,81,0.25);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.keys-pill b { color: var(--gold); }

/* ===== HINT BAR ===== */
.hint-bar {
  display: flex; gap: 10px; justify-content: center;
  margin: 14px auto 4px; max-width: 480px; flex-wrap: wrap;
}
.btn-hint, .btn-hint-secondary {
  border: none; cursor: pointer;
  padding: 10px 16px; border-radius: 10px;
  font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform .15s ease, filter .2s, opacity .2s;
}
.btn-hint {
  background: linear-gradient(145deg, var(--gold), var(--gold-2));
  color: #1a1a1a;
  box-shadow: 0 4px 12px rgba(245,196,81,0.25);
}
.btn-hint:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08); }
.btn-hint:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.4); }
.btn-hint-secondary {
  background: var(--panel);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.08);
}
.btn-hint-secondary:hover { transform: translateY(-2px); filter: brightness(1.1); }
.hint-cost { font-size: 12px; opacity: 0.85; }
.hint-status {
  text-align: center; min-height: 18px; font-size: 13px;
  color: var(--muted); margin: 4px 0 0;
}
.hint-status.error { color: #ff7676; }
.hint-status.ok { color: var(--led-green); }

/* ===== HINTS PANEL ===== */
.hints-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 90; opacity: 0; transition: opacity .2s;
}
.hints-backdrop:not(.hidden) { opacity: 1; }
.hints-backdrop.hidden { display: none; }

.hints-panel {
  position: fixed; top: 0; right: 0; height: 100vh;
  width: min(380px, 90vw);
  background: linear-gradient(145deg, var(--panel-2), var(--panel));
  border-left: 1px solid rgba(255,255,255,0.08);
  box-shadow: -10px 0 40px rgba(0,0,0,0.6);
  z-index: 95;
  transform: translateX(100%);
  transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.hints-panel:not(.hidden) { transform: translateX(0); }
.hints-panel.hidden { transform: translateX(100%); pointer-events: none; }
.hints-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.hints-panel-header h3 {
  margin: 0; font-family: "Orbitron", sans-serif; font-size: 16px;
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hints-panel-close {
  background: transparent; border: none; color: var(--text);
  font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.hints-panel-close:hover { background: rgba(255,255,255,0.06); }
.hints-panel-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.hints-panel-footer {
  padding: 12px 20px; border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 11px; color: var(--muted); text-align: center;
}
.hints-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 20px 0; }
.hints-empty.hidden { display: none; }
.hints-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.hint-item {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid var(--gold);
  padding: 10px 12px; border-radius: 8px; font-size: 13px;
}
.hint-item.level-1 { border-left-color: #6ee7b7; }
.hint-item.level-2 { border-left-color: #fbbf24; }
.hint-item.level-3 { border-left-color: #fb7185; }
.hint-item-meta {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--muted); margin-bottom: 4px; font-weight: 700;
}
.hint-item-text { color: var(--text); line-height: 1.4; }

/* ===== FAMILY REVEAL ===== */
.family-reveal {
  background: linear-gradient(145deg, rgba(245,196,81,0.12), rgba(245,196,81,0.04));
  border: 1px solid rgba(245,196,81,0.3);
  padding: 10px 14px; border-radius: 10px;
  margin-bottom: 12px; font-size: 14px; color: var(--text);
}
.family-reveal.hidden { display: none; }
.family-reveal b { color: var(--gold); font-family: "Orbitron", sans-serif; }

/* ===== MODAL CERTIFICAT ===== */
.cert-box {
  max-width: 540px;
  width: 95vw;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  padding: 22px 22px 18px;
}
.cert-close {
  position: absolute;
  top: 10px; right: 12px;
  background: transparent;
  border: none;
  color: #e8eef7;
  font-size: 22px;
  cursor: pointer;
  opacity: 0.7;
}
.cert-close:hover { opacity: 1; }
.cert-modal-title {
  margin: 0 0 4px;
  font-family: "Playfair Display", serif;
  font-size: 22px;
  text-align: center;
}
.cert-modal-sub {
  text-align: center;
  font-size: 13px;
  color: #9aa6c0;
  margin: 0 0 14px;
}
.cert-canvas-wrap {
  width: 100%;
  text-align: center;
  background: #0a0f1e;
  border-radius: 12px;
  padding: 10px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.cert-canvas-wrap canvas {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.45);
}
.cert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
}
.cert-actions button {
  flex: 1 1 auto;
  min-width: 120px;
}
.btn-cert {
  background: linear-gradient(135deg, #d4af37 0%, #b9881d 100%) !important;
  color: #1a1407 !important;
  font-weight: 700;
}

/* ============================================================ */
/* ============ v11: INFO PANEL + ONBOARDING + UX ============= */
/* ============================================================ */

/* === Info panel a dalt (engloba play-info i victory share-box) === */
.info-panel {
  margin: 6px auto 16px;
  max-width: 480px;
}

/* --- Mode JOC: caixa explicativa de pistes --- */
.play-info {
  background: linear-gradient(145deg, var(--panel-2), var(--panel));
  border: 1px solid rgba(245,196,81,0.18);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.05);
}
.play-info.hidden { display: none; }
.play-info-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.play-info-title {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: "Orbitron", sans-serif;
  font-size: 13px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--gold);
}
.play-info-icon { font-size: 18px; }
.play-info-keys {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--gold); font-weight: 700; font-size: 13px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(245,196,81,0.1);
  border: 1px solid rgba(245,196,81,0.25);
}
.play-info-desc {
  margin: 4px 0 12px; font-size: 13px; color: var(--muted); line-height: 1.45;
}

/* La hint-bar dins del play-info */
.play-info .hint-bar { margin: 4px 0 0; }
.play-info .hint-status { margin-top: 8px; font-size: 12px; }

/* Pulse subtil al botó de pista quan es desbloqueja per primer cop */
.btn-hint:not(:disabled).pulse {
  animation: hintPulse 1.4s ease-in-out 3;
}
@keyframes hintPulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(245,196,81,0.25); }
  50% { box-shadow: 0 0 0 8px rgba(245,196,81,0.3), 0 4px 18px rgba(245,196,81,0.5); }
}

/* --- Mode VICTÒRIA: capçalera medalla + frase --- */
.share-box {
  margin-top: 0;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--panel), var(--panel-2));
  box-shadow: 0 6px 18px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.05);
  border: 1px solid rgba(245,196,81,0.25);
  text-align: center;
  animation: fadeInUp .35s ease-out;
}
.victory-head {
  display: flex; align-items: center; gap: 12px;
  text-align: left; margin-bottom: 10px;
}
.victory-medal-mini {
  width: 96px; height: 104px; flex: 0 0 96px;
  display: grid; place-items: center;
  background: transparent;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.35));
  transition: transform .25s ease;
}
.victory-medal-mini:hover { transform: translateY(-2px) scale(1.04); }
.victory-medal-mini svg { width: 100%; height: 100%; display: block; }
.victory-text { flex: 1; min-width: 0; }
.victory-title {
  margin: 0;
  font-family: "Orbitron", sans-serif; font-size: 16px; letter-spacing: 0.5px;
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.victory-stats {
  margin: 2px 0 0; font-size: 12px; color: var(--muted);
}

/* La family-reveal dins de victory */
.share-box .family-reveal { margin-bottom: 12px; }

/* CTA principal: medalla destacada */
.btn-cert {
  background: linear-gradient(135deg, #d4af37 0%, #b9881d 100%) !important;
  color: #1a1407 !important;
  font-weight: 800;
  flex: 1 1 100%;
  justify-content: center;
  padding: 12px 16px !important;
}

/* === ONBOARDING (primera visita) === */
.onboarding {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 16px;
  animation: fadeIn .25s;
}
.onboarding.hidden { display: none; }
.onboarding-box {
  background: linear-gradient(145deg, var(--panel-2), var(--panel));
  border: 1px solid rgba(245,196,81,0.3);
  border-radius: 18px;
  padding: 28px 24px 22px;
  max-width: 420px; width: 100%;
  text-align: center;
  box-shadow: 0 30px 60px rgba(0,0,0,0.6);
  animation: popIn .3s ease-out;
}
@keyframes popIn {
  from { opacity: 0; transform: scale(.92); }
  to { opacity: 1; transform: scale(1); }
}
.onboarding-lang {
  display: flex; justify-content: center; gap: 6px;
  margin: -8px 0 14px;
}
.onboarding-lang .lang-btn {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  padding: 4px 12px;
  font: 700 12px/1 "Inter", system-ui, sans-serif;
  cursor: pointer;
  transition: all .15s ease;
}
.onboarding-lang .lang-btn:hover { background: rgba(255,255,255,0.12); }
.onboarding-lang .lang-btn.active {
  background: var(--accent, #f5c451);
  color: #1a1a1a; border-color: transparent;
}
.onboarding-icon {
  font-size: 56px; margin-bottom: 8px;
}
.onboarding-box h3 {
  margin: 0 0 16px;
  font-family: "Orbitron", sans-serif;
  font-size: 20px;
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.onboarding-steps {
  list-style: none; padding: 0; margin: 0 0 20px;
  text-align: left;
  display: flex; flex-direction: column; gap: 12px;
}
.onboarding-steps li {
  background: rgba(255,255,255,0.04);
  padding: 12px 14px;
  border-radius: 10px;
  border-left: 3px solid var(--gold);
  font-size: 14px; line-height: 1.5;
  color: var(--text);
}
.onboarding-steps li b {
  display: block; color: var(--gold); margin-bottom: 2px;
  font-family: "Space Grotesk", sans-serif;
}
.onboarding .btn-primary { width: 100%; padding: 14px; font-size: 15px; }

/* Mòbil: ajustos */
@media (max-width: 420px) {
  .play-info { padding: 12px 14px; }
  .play-info-desc { font-size: 12px; }
  .victory-medal-mini { width: 78px; height: 86px; flex-basis: 78px; }
  .victory-title { font-size: 14px; }
  .onboarding-box { padding: 22px 18px 18px; }
}
