/* Mythic Memory – στυλ. Παλέτα του TzinGames (σκούρο μπλε) με χρυσό και τερακότα.
   Κινήσεις μόνο με transform/opacity· κανένα animated box-shadow/filter/backdrop-filter. */
@font-face {
  font-family: "Play"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(../../assets/fonts/play-greek-700-normal.woff2) format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: "Play"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(../../assets/fonts/play-latin-700-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(../../assets/fonts/manrope-greek-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(../../assets/fonts/manrope-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #0B1226;
  --surface: #141D38;
  --surface-2: #1B2648;
  --text: #E3E9F7;
  --muted: #A9B4D0;
  --primary: #5B95FF;
  --secondary: #FF9A45;
  --gold: #E8C66A;
  --gold-2: #FFD84D;
  --line: rgba(227, 233, 247, .16);
  --gline: rgba(232, 198, 106, .4);
  --glass: rgba(13, 20, 42, .84);
  --head: "Play", "Manrope", system-ui, sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none;
  background: var(--bg); color: var(--text); font: 15px/1.45 var(--body);
  -webkit-text-size-adjust: 100%; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:not(:disabled) { cursor: pointer; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
svg { display: block; }
img { -webkit-user-drag: none; user-select: none; }

/* ---------- Σκηνικό (fx.js): στατική εικόνα + σύννεφα που κυλούν + καμβάς βροχής ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: var(--bg); }
.bg > * { position: absolute; }
.bg-par { inset: 0; }
.bg-par img { position: absolute; display: block; max-width: none; }
.bg-lit { opacity: 0; }
.bg-drift { left: 0; top: 4%; }
.bg-drift img { display: block; max-width: none; }
/* υψηλά εφέ: τα σύννεφα κυλούν μέσα στον καμβά .bg-fx· η στατική εικόνα τους μόνο στα χαμηλά */
.bg.live .bg-drift { display: none; }
.bg-fx { left: 0; top: 0; width: 100%; height: 100%; }
.bg-flash { inset: 0; opacity: 0; background: radial-gradient(ellipse at 50% 15%, rgba(205, 222, 255, .5), rgba(140, 170, 255, .1) 60%, transparent); }
.bg.bolt-a .bg-lit { animation: boltA .9s ease-out; }
.bg.bolt-b .bg-lit { animation: boltB .9s ease-out; }
.bg.bolt-a .bg-flash { animation: flashA .9s ease-out; }
.bg.bolt-b .bg-flash { animation: flashB .9s ease-out; }
@keyframes boltA { 0% { opacity: 0; } 6% { opacity: 1; } 14% { opacity: .15; } 22% { opacity: .9; } 100% { opacity: 0; } }
@keyframes boltB { 0% { opacity: 0; } 6% { opacity: 1; } 14% { opacity: .15; } 22% { opacity: .9; } 100% { opacity: 0; } }
@keyframes flashA { 0% { opacity: 0; } 6% { opacity: .75; } 14% { opacity: .1; } 22% { opacity: .55; } 100% { opacity: 0; } }
@keyframes flashB { 0% { opacity: 0; } 6% { opacity: .75; } 14% { opacity: .1; } 22% { opacity: .55; } 100% { opacity: 0; } }
.bg.won .bg-flash { animation: flashW 1.1s ease-out; }
@keyframes flashW { 0% { opacity: 0; } 8% { opacity: .7; } 18% { opacity: .15; } 26% { opacity: .5; } 100% { opacity: 0; } }

/* ---------- Διάταξη: πάντα μέσα στην οθόνη, χωρίς κύλιση ---------- */
#app {
  position: fixed; inset: 0; z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  grid-template-areas: "top" "hud" "prog" "board" "act";
  gap: 6px;
  padding:
    max(8px, env(safe-area-inset-top))
    max(8px, env(safe-area-inset-right), calc((100vw - 1240px) / 2))
    max(8px, env(safe-area-inset-bottom))
    max(8px, env(safe-area-inset-left), calc((100vw - 1240px) / 2));
}

.topbar { grid-area: top; display: flex; align-items: center; gap: 6px; min-width: 0; }
.stage-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 0 4px; text-shadow: 0 1px 3px rgba(0, 0, 0, .9); }
.stage-info b { font: 700 17px/1.1 var(--head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip {
  flex: none; font: 700 11.5px/1 var(--body); letter-spacing: .04em; text-transform: uppercase;
  padding: 5px 8px; border-radius: 999px; border: 1px solid var(--gline); color: var(--gold); background: rgba(11, 18, 38, .72); text-shadow: none;
}
.chip[data-d="legendary"] { color: #FF9AD8; border-color: rgba(255, 114, 198, .5); }

.ibtn {
  flex: none; width: 44px; height: 44px; display: inline-grid; place-items: center; padding: 0;
  border-radius: 12px; border: 1px solid var(--line); background: var(--glass);
  font: 700 14px/1 var(--head);
}
.ibtn:hover:not(:disabled) { background: var(--surface-2); }
.ibtn:disabled { opacity: .45; }
.ibtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ibtn svg .fill, .abtn svg .fill, .stg svg .fill { fill: currentColor; stroke: none; }
.ibtn[aria-pressed="true"] { color: var(--muted); }

/* HUD */
.hud {
  grid-area: hud; display: flex; align-items: center; gap: 2px; min-width: 0;
  padding: 3px 4px 3px 6px; border-radius: 14px; border: 1px solid var(--gline);
  background: var(--glass);
}
.stat { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 2px 1px; }
.stat .lbl {
  max-width: 100%; font-size: 10.5px; line-height: 1.2; color: var(--muted); letter-spacing: .03em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat b { font: 700 16px/1.25 var(--head); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat.sec { display: none; }
.hud.open { flex-wrap: wrap; }
.hud.open .stat.sec { display: flex; }
.hud.open .stat { flex-basis: 18%; }
.hud .more { width: 44px; height: 40px; border: 0; background: transparent; }
.hud.open .more svg { transform: rotate(180deg); }
.hearts { display: inline-flex; gap: 1px; padding-top: 2px; }
.hearts i { display: block; width: 15px; height: 15px; }
.hearts svg { width: 100%; height: 100%; }
.hearts .on svg { fill: #FF4D6A; }
.hearts .off svg { fill: #34406A; }
.hearts .lost { animation: heartLost .6s ease; }
@keyframes heartLost { 0% { transform: scale(1.5); } 40% { transform: scale(.7) rotate(-15deg); } 100% { transform: none; } }
#vMult.hot { color: var(--secondary); }
body.blessed #vMult { color: var(--gold-2); }

.progress { grid-area: prog; height: 5px; border-radius: 99px; background: rgba(227, 233, 247, .12); overflow: hidden; }
.progress i { display: block; height: 100%; width: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--secondary)); transform: scaleX(0); transform-origin: 0 50%; transition: transform .45s ease; }

/* ---------- Ταμπλό ---------- */
.board { grid-area: board; position: relative; min-height: 0; min-width: 0; display: grid; place-items: center; }
body.blessed .board::before {
  content: ""; position: absolute; inset: -4px; border-radius: 18px; pointer-events: none;
  box-shadow: inset 0 0 0 2px rgba(255, 216, 77, .5), inset 0 0 40px rgba(255, 216, 77, .18);
  animation: blessGlow 1.6s ease-in-out infinite alternate;
}
@keyframes blessGlow { from { opacity: .55; } to { opacity: 1; } }
/* flex αντί για grid: η τελευταία, μισή σειρά μένει στο κέντρο */
.grid {
  --cw: 80px; --ch: 107px; --gap: 8px; --cols: 4;
  display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: var(--gap);
  width: calc(var(--cols) * var(--cw) + (var(--cols) - 1) * var(--gap));
}
.grid > .card { flex: none; }

/* ---------- Κάρτα 3D ----------
   .card (θέση, ανακάτεμα, μοίρασμα) › .tilt (κλίση) › .lift (ανύψωση) › .card-inner (περιστροφή) › όψεις */
.card {
  position: relative; width: var(--cw); height: var(--ch); padding: 0; border: 0; background: none;
  border-radius: calc(var(--cw) * .075); contain: layout style;
}
.card .glow {
  position: absolute; left: -12.5%; top: -9.375%; width: 125%; height: 118.75%; pointer-events: none;
  background: var(--glow) center / 100% 100% no-repeat; opacity: 0;
}
.tilt, .lift, .card-inner { position: absolute; inset: 0; border-radius: inherit; }
.tilt { transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.card.tilting .tilt { transition: none; will-change: transform; }
.card-inner {
  transform-style: preserve-3d; transform: perspective(900px) rotateY(0deg);
  transition: transform .5s cubic-bezier(.3, .1, .2, 1);
}
.card.up .card-inner { transform: perspective(900px) rotateY(180deg); }
.card.fa .card-inner, .card.fb .card-inner { will-change: transform; }
.face {
  position: absolute; inset: 0; border-radius: inherit; contain: layout paint;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 5px 12px rgba(0, 0, 0, .45);
}
.face img { display: block; width: 100%; height: 100%; pointer-events: none; }
.face.front { transform: rotateY(180deg); }
.face .shade { position: absolute; inset: 0; border-radius: inherit; opacity: 0; pointer-events: none; background: linear-gradient(90deg, rgba(4, 6, 16, .9), rgba(4, 6, 16, .55)); }
.face::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  transition: opacity .18s;
}
.face.back::after { background: rgba(255, 240, 200, .12); }
.face.front::after { box-shadow: inset 0 0 0 3px var(--ring, #FF4D5E); }
.card:not(.up):hover .face.back::after { opacity: 1; }
.card.miss .face.front::after { opacity: 1; }
.card.peek .face.front::after { --ring: var(--gold-2); opacity: 1; }
.front .name {
  position: absolute; left: 13.75%; right: 13.75%; top: 83.75%; height: 8.75%;
  display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap;
  font: 700 clamp(7px, calc(var(--cw) * .1), 17px)/1 var(--head); color: #F3D27A; letter-spacing: .01em;
}
/* λωρίδες φωτός: κινούνται μόνο με transform */
.shine, .glint { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.shine::before, .glint::before {
  content: ""; position: absolute; top: -10%; bottom: -10%; left: 0; width: 55%;
  background: linear-gradient(100deg, rgba(255, 246, 210, 0) 10%, rgba(255, 246, 210, .5) 50%, rgba(255, 246, 210, 0) 90%);
  transform: translate3d(-130%, 0, 0);
}
.glint::before { background: linear-gradient(100deg, rgba(200, 225, 255, 0) 10%, rgba(220, 235, 255, .45) 50%, rgba(200, 225, 255, 0) 90%); }

/* γύρισμα: ανύψωση στη μέση, σκοτείνιασμα όσο η κάρτα γυρίζει «στην κόψη», λάμψη στο τέλος */
.card.fa .lift { animation: liftA .5s cubic-bezier(.3, .1, .2, 1); }
.card.fb .lift { animation: liftB .5s cubic-bezier(.3, .1, .2, 1); }
@keyframes liftA { 45% { transform: translate3d(0, -5%, 0) scale(1.07); } }
@keyframes liftB { 45% { transform: translate3d(0, -5%, 0) scale(1.07); } }
.card.fa .shade { animation: shadeA .5s linear; }
.card.fb .shade { animation: shadeB .5s linear; }
@keyframes shadeA { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
@keyframes shadeB { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
.card.up.fa .shine::before { animation: sweepA .8s ease-out; }
.card.up.fb .shine::before { animation: sweepB .8s ease-out; }
@keyframes sweepA { 0%, 40% { transform: translate3d(-130%, 0, 0); } 100% { transform: translate3d(240%, 0, 0); } }
@keyframes sweepB { 0%, 40% { transform: translate3d(-130%, 0, 0); } 100% { transform: translate3d(240%, 0, 0); } }
.card.gl .glint::before { animation: sweepG 1.2s ease-in-out; }
@keyframes sweepG { to { transform: translate3d(240%, 0, 0); } }

.card.deal { animation: deal .55s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(var(--i) * 22ms); }
@keyframes deal { from { opacity: 0; transform: translate3d(0, 28px, 0) scale(.86); } }
.card.matched { animation: matchPop .6s ease; }
@keyframes matchPop { 40% { transform: scale(1.08); } }
.card.matched .glow { animation: glowIn 1.4s ease forwards; }
@keyframes glowIn { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: .5; } }
.card.miss { animation: missShake .45s ease; }
@keyframes missShake {
  20% { transform: translate3d(-7px, 0, 0); }
  40% { transform: translate3d(7px, 0, 0); }
  60% { transform: translate3d(-5px, 0, 0); }
  80% { transform: translate3d(4px, 0, 0); }
}
.card:focus-visible, body.kbd .card:focus { outline: 3px solid var(--gold-2); outline-offset: 3px; }
.grid.shuffling .card:not(.matched) { z-index: 2; }
.grid.paused .card { opacity: .1; pointer-events: none; }

.banner {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%); z-index: 5;
  padding: 7px 16px 9px; border-radius: 999px; overflow: hidden;
  background: rgba(11, 18, 38, .92); border: 1px solid var(--gline);
  font: 700 15px/1.2 var(--head); color: var(--gold-2); white-space: nowrap; pointer-events: none;
}
.banner i { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--gold); transform-origin: 0 50%; }
.banner.run i { animation: shrink var(--ms, 1s) linear .45s forwards; }
@keyframes shrink { to { transform: scaleX(0); } }

.toast {
  position: absolute; left: 50%; bottom: 6px; z-index: 6; max-width: calc(100% - 16px);
  transform: translate(-50%, 10px); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
  padding: 8px 14px; border-radius: 12px; background: rgba(11, 18, 38, .95); border: 1px solid var(--gline);
  font-weight: 700; font-size: 14px; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
/* combo: μόνο transform/opacity */
.combo {
  position: absolute; left: 50%; top: 38%; z-index: 7; pointer-events: none; opacity: 0; white-space: nowrap;
  font: 700 clamp(26px, 6vw, 44px)/1 var(--head); color: var(--gold-2); letter-spacing: .02em;
  text-shadow: 0 2px 0 #7A4A12, 0 4px 14px rgba(0, 0, 0, .85);
  transform: translate(-50%, -50%) scale(.6);
}
.combo.run { animation: comboIn .9s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes comboIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.6) rotate(-6deg); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.12) rotate(2deg); }
  60% { opacity: 1; transform: translate(-50%, -60%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -95%) scale(.96); }
}
/* ειδοποιήσεις (άθλοι, κοινοποίηση): πάνω από όλα τα παράθυρα */
.note {
  position: fixed; left: 50%; top: max(12px, env(safe-area-inset-top)); z-index: 40; max-width: calc(100% - 24px);
  display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 10px; border-radius: 14px;
  background: rgba(16, 24, 50, .97); border: 1px solid var(--gold); box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  font-weight: 700; font-size: 14.5px; color: var(--text); pointer-events: none;
  opacity: 0; transform: translate(-50%, -16px);
}
.note:empty { display: none; }
.note.show { animation: noteIn 2.1s ease forwards; }
@keyframes noteIn { 0% { opacity: 0; transform: translate(-50%, -16px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -8px); } }
.nf-ico { width: 34px; flex: none; }
.pop {
  position: absolute; z-index: 7; transform: translate(-50%, -50%); pointer-events: none;
  font: 700 20px/1 var(--head); color: var(--gold-2); text-shadow: 0 2px 6px rgba(0, 0, 0, .8);
  animation: popUp .95s ease-out forwards;
}
@keyframes popUp { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -170%) scale(1); } }

/* ---------- Κουμπιά ενεργειών ---------- */
.actions { grid-area: act; display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; }
.abtn {
  position: relative; overflow: hidden; min-height: 46px; min-width: 46px; padding: 0 14px;
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 14px; border: 1px solid var(--gline);
  background: linear-gradient(180deg, #1E2A50, #131C38);
  font-weight: 700; font-size: 14.5px;
}
.abtn svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.abtn svg .fill { fill: var(--gold-2); }
.abtn b { min-width: 26px; padding: 2px 7px; border-radius: 999px; background: rgba(227, 233, 247, .1); font: 700 13px/1.3 var(--head); text-align: center; position: relative; z-index: 1; }
.abtn .txt, .abtn svg { position: relative; z-index: 1; }
.abtn:hover:not(:disabled) { border-color: var(--gold); }
.abtn:disabled { opacity: .5; }
.abtn.bless.short:not(.on) { opacity: .65; }
.abtn .bar { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, rgba(255, 216, 77, .35), rgba(255, 154, 69, .35)); display: none; }
.abtn.bless.on { opacity: 1; border-color: var(--gold-2); }
.abtn.bless.on .bar { display: block; }
.chaos {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 999px;
  border: 1px solid rgba(255, 114, 198, .5); color: #FF9AD8; background: var(--glass); font: 700 13px/1 var(--head); font-variant-numeric: tabular-nums;
}
.chaos svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* χώρος για το «← TzinGames» κάτω αριστερά (μόνο εκτός iframe) */
body.standalone .actions { padding-left: 106px; }
body.standalone .overlay { padding-bottom: max(44px, env(safe-area-inset-bottom)); }

/* ---------- Παράθυρα (χωρίς backdrop-filter) ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 20; display: flex; overflow: auto; overscroll-behavior: contain;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: rgba(5, 8, 20, .76);
  animation: fadeIn .2s ease;
}
.overlay.start { background: rgba(5, 8, 20, .28); }
#ovHow, #ovSet, #ovPan { z-index: 24; }
#ovHow { z-index: 26; }
@keyframes fadeIn { from { opacity: 0; } }
.panel {
  position: relative; margin: auto; width: min(560px, 100%);
  padding: 20px; border-radius: 20px; border: 1px solid var(--gline);
  background: linear-gradient(180deg, rgba(29, 41, 80, .98), rgba(17, 25, 50, .98));
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .06);
  animation: rise .28s cubic-bezier(.2, .8, .2, 1);
}
.panel.small { width: min(380px, 100%); text-align: center; }
@keyframes rise { from { transform: translate3d(0, 16px, 0) scale(.97); opacity: 0; } }
.panel h2 { font: 700 13px/1.2 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 16px 0 8px; }
.panel.small h2, .panel.how > h2, .panel.end h2, .panel.pan > h2 { font: 700 24px/1.2 var(--head); letter-spacing: .01em; text-transform: none; color: var(--gold-2); margin: 0 0 12px; }

/* ---------- Αρχική οθόνη ---------- */
.panel.menu {
  width: min(800px, 100%); height: 100%; max-height: 860px; display: flex; flex-direction: column;
  padding: 12px 16px 16px; background: linear-gradient(180deg, rgba(14, 22, 48, .88), rgba(9, 14, 32, .92));
}
.menu-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mark { flex: none; width: 44px; }
.menu-tools { display: flex; gap: 6px; }
.menu-head { text-align: center; margin: 0 0 10px; }
.menu-head h1 {
  margin: 0; font: 700 clamp(30px, 7.5vw, 50px)/1.05 var(--head); letter-spacing: .02em;
  background: linear-gradient(180deg, #FFF6CF 10%, #F2C75A 55%, #B98328 95%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.menu-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.diffs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.diff {
  min-height: 50px; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 2px;
  border-radius: 12px; border: 1px solid var(--line); background: rgba(11, 18, 38, .62);
}
.diff b { font: 700 14.5px/1.15 var(--head); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diff small { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--gold); font-variant-numeric: tabular-nums; }
.sti { width: 10px; height: 10px; background: currentColor; clip-path: polygon(50% 0, 62% 35%, 100% 38%, 70% 60%, 80% 100%, 50% 77%, 20% 100%, 30% 60%, 0 38%, 38% 35%); }
.diff.sel { border-color: var(--gold); background: linear-gradient(180deg, rgba(232, 198, 106, .22), rgba(232, 198, 106, .06)); box-shadow: inset 0 0 0 1px var(--gold); }
.diff[data-th="storm"].sel { border-color: #FF9AD8; box-shadow: inset 0 0 0 1px #FF9AD8; background: linear-gradient(180deg, rgba(255, 114, 198, .2), rgba(255, 114, 198, .05)); }
.daily {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; margin-top: 8px; padding: 6px 12px; text-align: left;
  border-radius: 14px; border: 1px solid rgba(255, 154, 69, .55);
  background: linear-gradient(100deg, rgba(255, 154, 69, .2), rgba(232, 198, 106, .08) 60%, rgba(11, 18, 38, .6));
}
.daily:hover { border-color: var(--secondary); }
.d-ico { flex: none; width: 26px; height: 26px; fill: none; stroke: var(--secondary); stroke-width: 2; stroke-linecap: round; }
.d-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.d-txt b { font: 700 15.5px/1.2 var(--head); color: #FFE2B8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-txt small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; font-variant-numeric: tabular-nums; }
.d-meta { display: flex; gap: 8px; color: var(--gold); font-weight: 700; }
.d-meta:empty { display: none; }
.d-cd { color: var(--muted); }
.map {
  position: relative; flex: 1 1 auto; min-height: 210px; margin: 10px 0 6px; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--gline);
  background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(232, 198, 106, .12), transparent 70%), rgba(6, 10, 26, .5);
}
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.trail { fill: none; stroke: rgba(232, 198, 106, .45); stroke-width: 3; stroke-dasharray: 1 9; stroke-linecap: round; }
.trail-on { fill: none; stroke: var(--gold); stroke-width: 3.5; stroke-linecap: round; opacity: .9; }
.map-nodes { position: absolute; inset: 0; }
.stg {
  position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; padding: 0; margin: -23px 0 0 -23px;
  display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--gold);
  background: radial-gradient(circle at 35% 30%, #2D4382, #121B3A); box-shadow: 0 4px 10px rgba(0, 0, 0, .55);
}
.stg b { font: 700 17px/1 var(--head); color: #FFF3C4; }
.stg b svg { width: 18px; height: 18px; color: var(--muted); }
.stg .st { position: absolute; top: 100%; left: 50%; display: flex; gap: 1px; transform: translate(-50%, 3px); }
.stg .st i { width: 10px; height: 10px; background: #3A4670; clip-path: polygon(50% 0, 62% 35%, 100% 38%, 70% 60%, 80% 100%, 50% 77%, 20% 100%, 30% 60%, 0 38%, 38% 35%); }
.stg .st i.on { background: var(--gold-2); }
.stg.lock { border-color: #4A5578; background: #121A33; }
.stg.lock .st { display: none; }
.stg.top { width: 52px; height: 52px; margin: -26px 0 0 -26px; }
.stg.sel { border-color: #FFF3C4; background: radial-gradient(circle at 35% 30%, #FBE29A, #B07A28); }
.stg.sel b { color: #1A0E08; }
.stg.sel::after {
  content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid rgba(255, 216, 77, .75); pointer-events: none;
  animation: ring 1.8s ease-out infinite;
}
@keyframes ring { from { transform: scale(.82); opacity: 1; } to { transform: scale(1.32); opacity: 0; } }
.map-info { margin: 0 0 4px; text-align: center; font-size: 13px; color: var(--muted); }
.map-info b { color: var(--gold); }
.menu-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.menu-actions.col { flex-direction: column; align-items: stretch; }
.btn {
  min-height: 46px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface-2); font-weight: 700; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.btn svg { width: 20px; height: 20px; fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn b { color: var(--gold); font-variant-numeric: tabular-nums; }
.btn:hover { border-color: var(--primary); }
.btn:disabled { opacity: .6; }
.btn.primary { background: linear-gradient(180deg, #F8DD8A, #D9A23F); color: #1A0E08; border-color: transparent; box-shadow: 0 6px 18px rgba(217, 162, 63, .3); }
.btn.primary:hover { border-color: #FFF3C4; }
.btn.ghost { background: transparent; }

/* ---------- Πάνθεον ---------- */
.panel.pan { width: min(760px, 100%); }
.close { position: absolute; top: 12px; right: 12px; }
.pan-detail { display: flex; gap: 14px; align-items: center; padding: 10px; border-radius: 14px; background: rgba(11, 18, 38, .6); border: 1px solid var(--line); min-height: 140px; }
.pd-card { position: relative; flex: none; width: 96px; }
.pd-img { display: block; width: 96px; aspect-ratio: 3 / 4; }
/* όνομα θεού πάνω στην κορδέλα της μικρογραφίας (ίδια θέση με την κάρτα του παιχνιδιού) */
.pname {
  position: absolute; left: 13.75%; right: 13.75%; top: 83.75%; height: 8.75%; pointer-events: none;
  display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap;
  font: 700 9px/1 var(--head); color: #F3D27A;
}
.pd-card .pname { font-size: 11px; }
.pan-detail h3 { margin: 0 0 4px; font: 700 21px/1.2 var(--head); color: var(--gold-2); }
.pan-detail h3.unk { color: var(--muted); }
.pan-detail p { margin: 0; color: #D3DBEE; font-size: 14.5px; }
.pan-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.pg { position: relative; padding: 0; border: 2px solid transparent; border-radius: 9px; background: none; aspect-ratio: 3 / 4; }
.pg img { display: block; width: 100%; height: 100%; }
.pg.sel { border-color: var(--gold-2); }
/* καρτέλες: Θεοί / Άθλοι / Τρόπαια / Στατιστικά */
.tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 0 48px 10px 0; padding: 3px; border-radius: 14px; border: 1px solid var(--line); background: rgba(11, 18, 38, .6); }
.tabs button { min-height: 44px; min-width: 0; padding: 0 4px; border: 0; border-radius: 11px; background: transparent; font-weight: 700; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs button[aria-selected="true"] { background: linear-gradient(180deg, rgba(232, 198, 106, .28), rgba(232, 198, 106, .1)); color: var(--gold-2); box-shadow: inset 0 0 0 1px var(--gline); }
.tab-sum { margin: 0 0 8px; font-weight: 700; color: var(--gold); }
.tab-sum b { color: var(--text); font-variant-numeric: tabular-nums; }
.trophies { margin: 0; padding: 0 0 0 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-size: 14px; color: var(--muted); }
.trophies li.got { color: var(--text); }
.trophies li b { color: var(--gold-2); margin-left: 6px; font-weight: 400; }
.feats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ft { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(11, 18, 38, .5); min-width: 0; }
.ft.got { border-color: var(--gline); background: linear-gradient(180deg, rgba(232, 198, 106, .14), rgba(11, 18, 38, .5)); }
.ft-ico { flex: none; width: 34px; height: 26px; display: grid; place-items: center; color: #56628A; }
.ft-ico svg { width: 100%; height: 100%; }
.ft:not(.got) .ft-ico svg { width: 18px; height: 18px; fill: currentColor; }
.ft-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ft-t b { font-size: 14px; line-height: 1.25; }
.ft:not(.got) .ft-t b { color: var(--muted); }
.ft-t small { font-size: 12px; line-height: 1.3; color: var(--muted); }
.ft time { flex: none; font-size: 11px; color: var(--gold); font-variant-numeric: tabular-nums; }
.stats { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.stats div { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(11, 18, 38, .5); }
.stats dt { font-size: 12.5px; color: var(--muted); }
.stats dd { margin: 2px 0 0; font: 700 22px/1.2 var(--head); color: var(--gold-2); font-variant-numeric: tabular-nums; }

/* ---------- Ρυθμίσεις ---------- */
.panel.set { text-align: left; }
.panel.set h2 { text-align: center; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px; font-weight: 700; }
.set-group { padding: 6px 0 4px; border-bottom: 1px solid var(--line); }
.set-group h3 { margin: 4px 0 0; font: 700 11.5px/1.2 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.seg { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { min-height: 44px; min-width: 76px; border: 0; background: transparent; font-weight: 700; }
.seg button[aria-pressed="true"] { background: var(--gold); color: #1A0E08; }
.set-note { margin: 6px 0 2px; font-size: 12.5px; color: var(--muted); }
.tgl { min-height: 44px; min-width: 100px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 700; }
.tgl[aria-checked="true"] { border-color: var(--gold); color: var(--gold-2); }

.how p { margin: 0 0 9px; font-size: 14.5px; color: #D3DBEE; }
.how b { color: var(--gold); }
.how .keys { color: var(--muted); font-size: 13.5px; }
kbd { display: inline-block; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); background: rgba(11, 18, 38, .6); font: 700 12px/1.4 var(--head); color: var(--text); }

/* ---------- Τέλος σταδίου ---------- */
.panel.end { text-align: center; width: min(500px, 100%); }
.end-acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.end-acts .btn { padding: 0 8px; min-width: 0; }
.end-acts .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.end-acts .btn.primary { grid-column: 1 / -1; }
.panel.end p { margin: 6px 0; color: #D3DBEE; }
.laurel { width: 96px; margin: -4px auto 4px; }
.over-t { color: #FF6B7A !important; }
.stars { display: flex; justify-content: center; gap: 10px; margin: 6px 0 12px; }
.star svg { width: 46px; height: 46px; fill: #2C375E; }
.star.on svg { fill: var(--gold-2); }
.stars.anim .star.on { animation: starIn .5s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: var(--d); }
@keyframes starIn { from { transform: scale(0) rotate(-90deg); opacity: 0; } }
.res { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 4px 0 8px; }
.res div { padding: 8px 4px 6px; border-radius: 12px; background: rgba(11, 18, 38, .55); border: 1px solid var(--line); }
.res div.ok { border-color: var(--gline); }
.res span { display: block; font-size: 11.5px; color: var(--muted); }
.res b { font: 700 18px/1.2 var(--head); }
.res small { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.res .ok small { color: var(--gold); }
.res small svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.newbest { color: var(--secondary) !important; font-weight: 700; }
.reward b, .newgods b { color: var(--gold-2); }
.reward span, .newgods span, .tg { color: var(--muted) !important; }
.tg { font-size: 12.5px; }
.final-t { color: var(--gold) !important; }
.panel.end.final { box-shadow: 0 0 0 1px var(--gold), 0 0 60px rgba(255, 216, 77, .25), 0 20px 60px rgba(0, 0, 0, .5); }

#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 30; pointer-events: none; }

/* ---------- Μικρές οθόνες ---------- */
@media (max-width: 520px) {
  .stage-info { flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; }
  .stage-info .chip { padding: 2px 6px; font-size: 10px; }
  .diff b { font-size: 13px; }
}
@media (max-width: 560px) {
  .panel.menu .menu-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .panel.menu .menu-actions .btn { padding: 0 10px; min-width: 0; }
  .panel.menu .menu-actions .btn.primary, .panel.menu .menu-actions [data-act="resume"] { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .abtn .txt { display: none; }
  .daily { gap: 8px; padding: 6px 10px; }
  .d-txt b { font-size: 14.5px; }
  .d-side { font-size: 11.5px; }
  .tabs button { font-size: 13px; }
  .feats { grid-template-columns: 1fr; }
  .stage-info b { font-size: 15px; }
  .panel { padding: 16px; }
  .panel.menu { padding: 10px 12px 12px; }
  .pan-detail p { font-size: 13.5px; }
  .pd-img { width: 80px; }
  .pan-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 370px) {
  .stat .lbl { font-size: 9.5px; }
  .stat b { font-size: 14.5px; }
  .hearts i { width: 13px; height: 13px; }
  .topbar { gap: 4px; }
  .menu-head p { font-size: 13px; }
}
@media (max-height: 760px) {
  .panel.end { padding-top: 12px; padding-bottom: 14px; }
  .laurel { width: 70px; }
  .star svg { width: 38px; height: 38px; }
  .stars { margin: 4px 0 8px; }
  .panel.end .tg { display: none; }
  .panel.end h2 { font-size: 21px; margin-bottom: 6px; }
}
@media (max-width: 420px) {
  .end-acts [data-act="share"] span { display: none; }
}
@media (max-height: 700px) and (orientation: portrait) {
  .menu-head h1 { font-size: 30px; }
  .menu-head { margin-bottom: 6px; }
  .menu-actions { margin-top: 8px; }
}

/* ---------- Μεγάλες οθόνες: όλα τα στατιστικά σε μία γραμμή ---------- */
@media (min-width: 900px) and (min-height: 600px) {
  .stat.sec { display: flex; }
  .hud .more { display: none; }
  .stat .lbl { font-size: 11.5px; }
  .stat b { font-size: 18px; }
  .hearts i { width: 17px; height: 17px; }
  #app { gap: 8px; }
  .stg { width: 52px; height: 52px; margin: -26px 0 0 -26px; }
  .stg.top { width: 58px; height: 58px; margin: -29px 0 0 -29px; }
  .diff { min-height: 56px; }
  .diff b { font-size: 16px; }
}

/* ---------- Κινητό οριζόντια: πλαϊνή στήλη ---------- */
@media (orientation: landscape) and (max-height: 540px) {
  #app {
    grid-template-columns: clamp(200px, 27vw, 270px) minmax(0, 1fr);
    grid-template-rows: auto auto auto minmax(0, 1fr);
    grid-template-areas: "top board" "hud board" "prog board" "act board";
    column-gap: 10px; row-gap: 6px;
  }
  .topbar { flex-wrap: wrap; gap: 6px 6px; }
  .stage-info { order: 5; flex-basis: 100%; padding: 0 2px; }
  .stage-info b { font-size: 15px; }
  .hud { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 4px; }
  .hud .more { justify-self: center; }
  .actions { align-self: end; flex-wrap: wrap; justify-content: flex-start; }
  .abtn .txt { display: none; }
  body.standalone .actions { padding-left: 0; margin-bottom: 34px; }
  .panel.menu {
    max-width: 960px; display: grid; padding: 10px 12px;
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr); grid-template-rows: auto auto auto auto 1fr;
    column-gap: 12px;
  }
  .panel.menu .menu-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .panel.menu .menu-actions .btn { padding: 0 8px; min-width: 0; font-size: 14px; }
  .panel.menu .menu-actions .btn.primary, .panel.menu .menu-actions [data-act="resume"] { grid-column: 1 / -1; }
  .panel.menu > * { grid-column: 1; }
  .panel.menu .map { grid-column: 2; grid-row: 2 / -1; margin: 0; min-height: 0; }
  .panel.menu .daily { grid-column: 2; grid-row: 1; margin: 0 0 6px; min-height: 46px; }
  .menu-head h1 { font-size: 27px; }
  .menu-head p { display: none; }
  .menu-head { margin: 2px 0 6px; }
  .diffs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .diff { min-height: 44px; flex-direction: row; gap: 6px; }
  .map-info { margin: 6px 0 0; font-size: 12px; text-align: left; }
  .menu-actions { margin-top: 8px; align-self: start; }
  .menu-actions .btn { padding: 0 12px; }
  .menu-top .mark { width: 38px; }
  .pan-detail { min-height: 0; }
  /* νίκη: πιο φαρδύ και χαμηλό παράθυρο, ώστε να χωράει χωρίς scroll */
  .panel.end { width: min(660px, 100%); padding: 10px 16px 12px; }
  .panel.end .laurel { display: none; }
  .panel.end h2 { font-size: 19px; margin-bottom: 2px; }
  .panel.end p { margin: 3px 0; font-size: 13.5px; }
  .stars { margin: 2px 0 6px; gap: 8px; }
  .star svg { width: 28px; height: 28px; }
  .res { margin: 2px 0 6px; }
  .res div { padding: 4px 4px 3px; }
  .res b { font-size: 15px; }
  .end-acts { grid-template-columns: none; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; }
  .end-acts .btn.primary { grid-column: auto; }
}
@media (orientation: landscape) and (max-height: 340px) {
  .hud .stat .lbl { display: none; }
}

/* ---------- Ελαφριά εφέ (αδύναμη συσκευή, επιλογή ή reduced motion) ---------- */
.fx-low .shade, .fx-low .shine, .fx-low .glint { display: none; }
/* κινητό: χωρίς σκίαση στο γύρισμα (κοστίζει στο main thread, μικρό οπτικό κέρδος) */
@media (pointer: coarse) { .shade { display: none; } }
.fx-low .card.fa .lift, .fx-low .card.fb .lift { animation: none; }
.fx-low .card-inner { transition-duration: .36s; }
.fx-low .stg.sel::after { animation: none; transform: scale(1.06); opacity: .8; }
/* παύση / κρυφή καρτέλα: σταματούν όλα τα animations του σκηνικού */
.still .bg *, .still .card, .still .card * { animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce) {
  .card-inner { transition-duration: .2s; }
  .card.matched, .card.miss, .card.deal, .pop, .hearts .lost { animation: none; }
  .bg-flash, .bg-lit { display: none !important; }
  body.blessed .board::before, .stg.sel::after { animation: none !important; }
  .panel, .overlay { animation: none; }
  /* χωρίς κίνηση: μόνο εμφάνιση/εξαφάνιση */
  .combo.run { animation: fadeOut 1s linear; }
  .note.show { animation: noteFade 2.1s linear forwards; }
}
@keyframes fadeOut { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
@keyframes noteFade { 0% { opacity: 0; transform: translate(-50%, 0); } 8%, 88% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 0); } }
.sparks { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 29; pointer-events: none; }
.sparks i { position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; background-size: 100% 100%; opacity: 0; }
