@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+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@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-03FF;
}
@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");
  unicode-range: U+0370-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");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* παλέτα TzinChicks (14 χρώματα) */
:root {
  --ink: #2a1a12;
  --cream: #fff8e6;
  --paper: #fffdf4;
  --straw: #e8c860;
  --wood: #c98a4b;
  --grass: #5e9a3e;
  --leaf: #7fbf4a;
  --sky: #8fd3ff;
  --sea: #2f7fbf;
  --red: #e2412f;
  --orange: #ff7a1a;
  --gold: #ffd23f;
  --fox: #e8742a;
  --plum: #6a3fb0;
  --back: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; overflow: hidden; background: #8fd3ff; color: var(--ink); font-family: "Manrope", system-ui, sans-serif; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
#cv { position: fixed; inset: 0; display: block; touch-action: none; }

/* κουμπιά */
.btn {
  display: block; width: 100%; margin-top: 10px; padding: 12px 18px; border: 3px solid var(--ink); border-radius: 16px;
  background: var(--cream); color: var(--ink); font: 700 18px/1.1 "Play", sans-serif; cursor: pointer;
  box-shadow: 0 5px 0 var(--ink); transition: transform .18s var(--back), box-shadow .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(4px) scale(.97); box-shadow: 0 1px 0 var(--ink); transition-duration: .06s; }
.btn.primary { background: linear-gradient(180deg, #ffe066, var(--gold)); }
.btn.ghost { background: rgba(255, 255, 255, .7); }
.btn.big { font-size: 24px; padding: 15px; }
.ib {
  min-width: 40px; height: 40px; border-radius: 12px; border: 3px solid var(--ink); background: var(--cream); color: var(--ink);
  font: 700 16px/1 "Play", sans-serif; cursor: pointer; box-shadow: 0 3px 0 var(--ink); transition: transform .15s var(--back);
}
.ib:active { transform: translateY(3px); box-shadow: none; }
.ib.off { opacity: .45; text-decoration: line-through; }

/* HUD */
#hud { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 8px); left: 8px; right: 160px; display: flex; align-items: center; gap: 10px; z-index: 5; pointer-events: none; }
#hud > * { pointer-events: auto; }
.lvl { background: rgba(255, 248, 230, .9); border: 3px solid var(--ink); border-radius: 12px; padding: 6px 12px; font: 700 15px "Play", sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc { margin-left: auto; text-align: right; background: rgba(42, 26, 18, .55); color: #fff; border-radius: 12px; padding: 4px 12px; }
.sc b { display: block; font: 700 22px "Play", sans-serif; }
.sc small { font-size: 12px; opacity: .85; }
.corner { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 8px); right: 8px; display: flex; gap: 6px; z-index: 9; }

/* οθόνες */
.screen { position: fixed; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(ellipse at 50% 40%, rgba(255, 248, 230, .25), rgba(42, 26, 18, .45)); }
.box {
  width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--paper); border: 4px solid var(--ink); border-radius: 26px;
  padding: 18px 20px 22px; text-align: center; box-shadow: 0 14px 0 rgba(42, 26, 18, .35), 0 20px 40px rgba(0, 0, 0, .3);
  animation: pop .45s var(--back) both;
}
@keyframes pop { from { transform: scale(.6) translateY(30px); opacity: 0; } }
h1 { font: 700 54px/1 "Play", sans-serif; color: var(--red); -webkit-text-stroke: 2px var(--ink); text-shadow: 0 5px 0 var(--ink); letter-spacing: 1px; margin: 4px 0 6px; }
h2 { font: 700 26px/1.15 "Play", sans-serif; margin-bottom: 8px; }
.tag { font-weight: 700; margin-bottom: 8px; }
#titleArt { width: 100%; max-width: 420px; height: auto; aspect-ratio: 420 / 150; }

/* χάρτης: ένας κόσμος τη φορά, οι πίστες πάνω σε μονοπάτι */
.map-box { width: min(820px, 100%); }
.map-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.map-top h2 { margin: 0; flex: 1; }
.map-top .ib:disabled { opacity: .3; cursor: default; }
.mstars { font: 700 16px "Play", sans-serif; color: #b07a00; margin: 4px 0 8px; }
.wmap { position: relative; width: 100%; aspect-ratio: 16 / 8; border: 4px solid var(--ink); border-radius: 20px; overflow: hidden; box-shadow: inset 0 -10px 0 rgba(0, 0, 0, .12); }
.wmap.locked > div { filter: grayscale(.8) brightness(.9); }
.wpath { position: absolute; inset: 0; width: 100%; height: 100%; }
.wpath polyline { fill: none; stroke: #fff8e6; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 2 12; vector-effect: non-scaling-stroke; opacity: .9; }
.wlock { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; background: var(--paper); border: 3px solid var(--ink); border-radius: 14px; padding: 8px 14px; font-weight: 800; }
.node {
  position: absolute; width: clamp(40px, 9.5%, 66px); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 4px solid var(--ink);
  background: radial-gradient(circle at 35% 30%, #fff, var(--straw) 60%, #c9a23c); font: 700 20px "Play", sans-serif; cursor: pointer; box-shadow: 0 5px 0 var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0;
  animation: pop .4s var(--back) both; animation-delay: calc(var(--i) * 35ms); transition: transform .18s var(--back);
}
.node:hover { transform: translate(-50%, -54%) rotate(-3deg); }
.node.done { background: radial-gradient(circle at 35% 30%, #fff, var(--leaf) 60%, var(--grass)); }
.node.cur::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 3px solid #fff8e6; animation: ring 1.4s ease-out .6s infinite; pointer-events: none; }
.node.boss { width: clamp(50px, 12%, 82px); background: radial-gradient(circle at 35% 30%, #fff, #ff9a4a 55%, #b8401e); }
.node.locked { background: #d8d2c4; cursor: default; opacity: .8; }
.node .s { font-size: 11px; letter-spacing: -1px; line-height: 1; }
.node .s i { color: rgba(42, 26, 18, .25); font-style: normal; }
.node .s i.on { color: var(--gold); -webkit-text-stroke: 1px var(--ink); }
@keyframes ring { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }

/* στολές */
.skins-box { width: min(760px, 100%); }
.sk-hens { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 4px 0 10px; }
.skh { width: 54px; height: 54px; border-radius: 14px; border: 3px solid var(--ink); background: var(--cream); cursor: pointer; padding: 0; box-shadow: 0 3px 0 var(--ink); }
.skh canvas { width: 46px; height: 46px; }
.skh.sel { background: var(--gold); transform: translateY(-2px); }
.sk-main { display: flex; gap: 12px; align-items: flex-start; }
.sk-prev { flex: none; width: 150px; margin: 0; }
.sk-prev canvas { width: 150px; height: 150px; }
.sk-prev figcaption { font: 700 16px "Play", sans-serif; }
.sk-items { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.ski { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border: 3px solid var(--ink); border-radius: 14px; background: #fff; cursor: pointer; box-shadow: 0 3px 0 var(--ink); font: 600 12px "Manrope", sans-serif; color: var(--ink); }
.ski canvas { width: 56px; height: 56px; }
.ski b { font: 700 13px "Play", sans-serif; }
.ski.owned { background: var(--cream); }
.ski.on { background: #d9f2c4; }
.ski:active { transform: translateY(3px); box-shadow: none; }
.sk-msg { min-height: 1.4em; margin: 6px 0 0; font-weight: 800; color: var(--red); }
.eggs-got { margin-top: 6px; font: 700 18px "Play", sans-serif; color: #b07a00; }

/* επιτεύγματα */
.achs-box { width: min(720px, 100%); }
.ach-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; text-align: left; margin-bottom: 4px; }
.ach { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 8px 10px; border: 3px solid rgba(42, 26, 18, .25); border-radius: 14px; background: #eee8da; color: rgba(42, 26, 18, .6); }
.ach i { grid-row: span 2; font-style: normal; font-size: 26px; text-align: center; }
.ach b { font: 700 14px "Play", sans-serif; }
.ach span { font-size: 12px; }
.ach.got { border-color: var(--ink); background: linear-gradient(180deg, #fff7d1, #ffe58a); color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
#toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); z-index: 12; display: flex; gap: 10px; align-items: center; padding: 8px 16px 8px 10px;
  background: linear-gradient(180deg, #fff7d1, #ffd23f); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 6px 0 rgba(42, 26, 18, .35); transform: translate(-50%, 160%); pointer-events: none; }
#toast.go { animation: toast 2.8s var(--back) both; }
#toast i { font-style: normal; font-size: 30px; }
#toast small { display: block; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
#toast b { font: 700 17px "Play", sans-serif; }
@keyframes toast { 0% { transform: translate(-50%, 160%); } 14%, 84% { transform: translate(-50%, 0); } 100% { transform: translate(-50%, 160%); } }
.btn.daily { background: linear-gradient(180deg, #c9f0ff, #8fd3ff); }
.btn.daily:disabled { opacity: .55; cursor: default; }
.daily-res { margin-top: 6px; font-weight: 800; color: #2f6fa0; }
.goal { background: rgba(255, 248, 230, .9); border: 3px solid var(--ink); border-radius: 12px; padding: 5px 10px; font: 700 14px "Play", sans-serif; white-space: nowrap; }

/* μπάρα του Αρχηγού */
.boss-bar { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 120px; flex: 1; max-width: 320px; }
.boss-bar span { font: 700 13px "Play", sans-serif; color: #fff; text-shadow: 0 2px 0 var(--ink); }
.boss-bar i { display: block; width: 100%; height: 12px; border: 3px solid var(--ink); border-radius: 8px; background: rgba(42, 26, 18, .5); overflow: hidden; }
.boss-bar b { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--red), var(--orange)); transition: width .3s ease; }

/* πώς παίζεται */
.how-box { width: min(620px, 100%); text-align: left; }
.how-box h2 { text-align: center; }
.how-body p { margin: 8px 0; line-height: 1.45; }
.cast { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 12px; }
.cast figure { text-align: center; font-size: 13px; }
.cast canvas { width: 72px; height: 72px; }
.cast figcaption b { display: block; font-family: "Play", sans-serif; }

/* αποτέλεσμα */
.stars { display: flex; justify-content: center; gap: 8px; margin: -6px 0 6px; }
.st { font-style: normal; font-size: 56px; color: #d8d2c4; -webkit-text-stroke: 3px var(--ink); transform: scale(.7); transition: transform .4s var(--back), color .2s; }
.st:nth-child(2) { font-size: 70px; transform: translateY(-10px) scale(.7); }
.st.on { color: var(--gold); transform: scale(1.1); }
.st:nth-child(2).on { transform: translateY(-10px) scale(1.1); }
.rscore { font: 700 40px "Play", sans-serif; color: var(--red); margin: 6px 0; }
.newbest { display: inline-block; background: var(--red); color: #fff; border-radius: 999px; padding: 3px 12px; font-weight: 800; }
.row { display: flex; gap: 8px; }
.result.lose h2 { color: #8a4a2a; }
#confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
#confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: fall 2.2s cubic-bezier(.25, .7, .4, 1) both; }
@keyframes fall { to { transform: translate(var(--x), 110vh) rotate(720deg); } }

/* συμβουλή */
#tip { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); transform: translateX(-50%); z-index: 7; width: min(560px, calc(100% - 24px));
  display: flex; gap: 10px; align-items: center; background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; padding: 8px 14px 8px 8px; box-shadow: 0 6px 0 rgba(42, 26, 18, .3); animation: pop .4s var(--back) both; cursor: pointer; }
#tip canvas { width: 56px; height: 56px; flex: none; }
#tip p { font-weight: 700; line-height: 1.35; }

/* γύρισε τη συσκευή */
#rotate { position: fixed; inset: 0; z-index: 20; background: #2a1a12; color: #fff8e6; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; }
#rotate .phone { font-size: 64px; animation: rot 1.6s ease-in-out infinite; }
#rotate p { font: 700 22px "Play", sans-serif; margin-top: 14px; }
#rotate .sub { font: 500 15px "Manrope", sans-serif; opacity: .85; }
@keyframes rot { 50% { transform: rotate(-90deg); } }

@media (max-height: 460px) {
  .box { padding: 12px 16px 16px; }
  h1 { font-size: 40px; }
  .btn { padding: 9px 14px; font-size: 16px; margin-top: 7px; }
  .wmap { aspect-ratio: 16 / 6.5; }
  .node { font-size: 15px; border-width: 3px; }
  .node .s { font-size: 9px; }
  .sk-prev, .sk-prev canvas { width: 100px; height: 100px; }
  .skh { width: 44px; height: 44px; } .skh canvas { width: 38px; height: 38px; }
  .st { font-size: 42px; } .st:nth-child(2) { font-size: 52px; }
  /* χαμηλή οθόνη (κινητό πλάγια): η ειδοποίηση μπαίνει από αριστερά, στο κενό δίπλα στο κουτί */
  #toast { left: 8px; bottom: 10px; max-width: calc(50vw - 236px); min-width: 150px; padding: 6px 10px 6px 8px; gap: 6px; transform: translate(-130%, 0); }
  #toast.go { animation-name: toastL; }
  #toast i { font-size: 22px; }
  #toast b { font-size: 14px; }
}
@keyframes toastL { 0% { transform: translate(-130%, 0); } 14%, 84% { transform: translate(0, 0); } 100% { transform: translate(-130%, 0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
