/* Ταυτότητα — the game's screens: archipelago, island path, results, passport, settings, effects.
   Colours come from the tokens in style.css; the sea and grass tokens live there too. */

/* ---- the archipelago (the exam home's sea block is the quiz's .k-sea, in style.css) ---- */
.arch { display: block; width: min(100%, 360px); margin: 0 auto; overflow: visible; }
.arch .waves path { fill: none; stroke: rgba(255, 255, 255, .7); stroke-width: 1.6; stroke-linecap: round; }
.arch .mainland .sand { fill: var(--sand); }
.arch .mlabel { font-size: 11px; font-weight: 800; fill: #0b3d6e; }   /* navy on sand in both modes */
.arch .isl { cursor: pointer; }
.arch .isl .sand { fill: var(--sand); transition: filter .2s; }
.arch .isl .grass { fill: var(--grass); }
.arch .isl.selected .sand, .arch .isl:focus-visible .sand { filter: drop-shadow(0 0 6px rgba(255, 255, 255, .95)); }
.arch .isl:focus { outline: none; }
.arch .iemoji { font-size: 22px; }
.arch .flag { font-size: 13px; }
.arch .ilabel-bg { fill: var(--card); }
.arch .ilabel { font-size: 10px; font-weight: 800; fill: var(--ink); }
.arch .lighthouse { cursor: pointer; }
.arch .lighthouse .rock { fill: var(--nb); stroke: var(--nb-edge); stroke-width: 1; }
.arch .lighthouse .count circle { fill: var(--bad); }
.arch .lighthouse .count text { font-size: 10px; font-weight: 800; fill: #fff; }
.arch .boat { font-size: 20px; transition: transform .9s cubic-bezier(.4, .1, .2, 1); }

/* ---- an island ---- */
.island-view { margin: 0 -16px; padding: 8px 14px 20px; background: linear-gradient(180deg, var(--sea-top) 0%, var(--sea-mid) 45%, var(--sea-deep) 100%); border-radius: 0 0 22px 22px; }
.ihead { display: flex; align-items: center; gap: 8px; padding: 6px 0 8px; }
.ihead .back { font-size: 14px; font-weight: 800; color: var(--accent-ink); text-decoration: none; }
.ihead .ttl { flex: 1; text-align: center; font-weight: 800; font-size: 17px; color: var(--ink); }
.ihead .prog { font-size: 12px; font-weight: 800; background: var(--card); color: var(--ink); border-radius: 12px; padding: 4px 9px; }
.isub { margin: 2px 0 6px; background: var(--btn); color: #fff; border-radius: 14px; padding: 9px 12px; box-shadow: 0 4px 0 var(--accent-dark); font-size: 13px; }
.isub b { font-size: 15px; display: block; }
.cove { margin: 14px 4px 0; font-size: 12px; font-weight: 800; letter-spacing: .5px; color: var(--ink); text-transform: uppercase; }
.ipath { position: relative; }
.port {
  position: absolute; width: 62px; height: 58px; margin-left: -31px; border-radius: 50%; border: none; cursor: pointer;
  display: grid; place-items: center; font: inherit; font-size: 22px; font-weight: 800; color: #fff;
  background: var(--btn); box-shadow: 0 6px 0 var(--accent-dark);
}
.port.done { background: var(--gold); box-shadow: 0 6px 0 var(--gold-dark); color: #3a2a00; }
.port.open { background: var(--btn); box-shadow: 0 6px 0 var(--accent-dark); }
.port.cur { background: var(--btn); box-shadow: 0 6px 0 var(--accent-dark); }
.port.cur::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 4px solid rgba(13, 94, 175, .35); animation: pulse 1.6s ease-out infinite; }
.port.lock { background: var(--nb); box-shadow: 0 6px 0 var(--nb-edge); color: var(--muted); font-size: 18px; cursor: default; }
.port:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 3px 0 var(--accent-dark); }
.port .pstars { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; background: var(--card); color: var(--amber); border-radius: 8px; padding: 0 5px; line-height: 16px; letter-spacing: 1px; white-space: nowrap; }
.port .pnum { position: absolute; top: -8px; right: -6px; font-size: 11px; background: var(--card); color: var(--ink); border-radius: 10px; padding: 0 6px; }
.port .bubble { position: absolute; top: -34px; left: 50%; transform: translateX(-50%); background: var(--card); color: var(--accent-ink); border-radius: 10px; padding: 3px 10px; font-size: 11px; font-weight: 800; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 60, 120, .15); animation: bob 1.4s ease-in-out infinite; }
.btn.tour { display: block; width: 100%; margin-top: 8px; background: var(--card); color: var(--accent-ink); box-shadow: 0 4px 0 var(--nb-edge); }
@keyframes pulse { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
@keyframes bob { 50% { transform: translate(-50%, -4px); } }

/* ---- port results ---- */
.results {
  position: relative; overflow: hidden; margin: 0 -16px; padding: 22px 16px 24px; text-align: center; border-radius: 0 0 22px 22px;
  background: linear-gradient(180deg, var(--btn) 0%, var(--accent-dark) 46%, var(--sea-top) 46.2%, var(--bg) 100%);
}
.results .top { color: #fff; }
.results .top small { display: block; opacity: .9; font-weight: 700; letter-spacing: .5px; font-size: 11px; }
.results .top b { font-size: 24px; }
.stars3 { display: flex; justify-content: center; gap: 6px; margin: 14px 0 4px; }
.stars3 .star { font-size: 50px; line-height: 1; color: rgba(255, 255, 255, .35); }
.stars3 .star.on { color: #ffd24a; text-shadow: 0 3px 0 var(--gold-dark); animation: reward-pop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.stars3 .star:nth-child(2) { font-size: 62px; margin-top: -10px; }
.perfect-line { color: #fff; font-weight: 800; font-size: 14px; margin-bottom: 18px; }
.wcard { margin: 0 auto 10px; max-width: 420px; background: var(--card); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); text-align: left; }
.wrow { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; font-weight: 700; }
.wrow span:last-child { font-weight: 800; }
.xpup { color: var(--accent-ink); animation: reward-rise .6s ease both; display: inline-block; }
.flame { display: inline-block; }
.flame.up { animation: flame .8s ease .4s both; }
.lvl { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 6px; }
.lbar { height: 10px; background: var(--accent-soft); border-radius: 6px; overflow: hidden; margin-top: 4px; }
.lbar b { display: block; height: 100%; background: linear-gradient(90deg, var(--btn), var(--accent)); border-radius: 6px; transition: width 1s ease .3s; }
.rankcard { margin: 8px auto; max-width: 420px; background: var(--gold); color: #3a2a00; border-radius: 14px; padding: 10px 14px; font-weight: 800; box-shadow: 0 4px 0 var(--gold-dark); animation: reward-pop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.rankcard small { display: block; font-weight: 700; }
.stamps-new { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 8px 0; }
.stamp-chip { background: var(--card); color: var(--ink); border-radius: 12px; padding: 4px 10px; font-size: 12px; font-weight: 800; box-shadow: var(--shadow); }
.wbtns { display: flex; flex-direction: column; gap: 8px; max-width: 420px; margin: 14px auto 0; }
.wbtns .btn { width: 100%; }
@keyframes reward-pop { 0% { transform: scale(0) rotate(-30deg); } 60% { transform: scale(1.25) rotate(6deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes reward-rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes flame { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.6); } }

/* ---- summaries ---- */
.summary .met { color: var(--ok-ink); font-weight: 800; }
.streak3 { display: inline-block; margin-left: 8px; background: var(--amber-soft); color: var(--amber); border-radius: 10px; padding: 1px 8px; font-size: 12px; }

/* ---- the lighthouse screen ---- */
.lighthouse-view h2 { color: var(--ink); }

/* ---- the passport ---- */
.passport { margin: 0 -16px; }
.phead { background: #0d3d6e; color: #f7e9c6; padding: 18px 16px 14px; }   /* the same navy in both modes (≈9:1) */
.phead small { display: block; letter-spacing: 2px; font-size: 10px; opacity: .85; font-weight: 700; }
.phead > b { font-size: 18px; }
.rank { display: flex; align-items: center; gap: 10px; margin-top: 10px; background: rgba(255, 255, 255, .12); border-radius: 12px; padding: 8px 10px; }
.rank .anc { font-size: 26px; }
.rank .bar { flex: 1; font-size: 13px; }
.rank .bar > div { height: 7px; border-radius: 5px; background: rgba(255, 255, 255, .25); margin-top: 4px; overflow: hidden; }
.rank .bar > div b { display: block; height: 100%; background: var(--gold); }
.rank .bar small { display: block; font-size: 11px; opacity: .85; margin-top: 4px; }
.stamps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 8px; padding: 16px 12px; }
.stamp { text-align: center; font-size: 11px; font-weight: 800; color: var(--ink); line-height: 1.2; }
.stamp .s { width: 70px; height: 70px; margin: 0 auto 5px; border-radius: 50%; border: 2.5px dashed currentColor; display: grid; place-items: center; font-size: 26px; transform: rotate(-8deg); background: var(--accent-soft); }
.stamp:nth-child(3n+2) .s { transform: rotate(6deg); }
.stamp small { display: block; font-weight: 600; color: var(--muted); font-size: 10px; margin-top: 2px; }
.stamp.on { color: var(--accent-ink); }
.stamp.on:nth-child(3n) { color: var(--bad-ink); }
.stamp.on:nth-child(3n+1) { color: var(--ok-ink); }
.stamp.off { color: var(--muted); }
.stamp.off .s { background: none; filter: grayscale(1); opacity: .6; }
.stamp.new .s { animation: stampin .6s ease both; }
@keyframes stampin { 0% { transform: scale(2.2) rotate(-25deg); opacity: 0; } 70% { transform: scale(.92) rotate(-8deg); opacity: 1; } 100% { transform: scale(1) rotate(-8deg); } }

/* ---- settings ---- */
.settings .field { display: block; margin: 14px 0; }
.settings .field span { display: block; font-weight: 700; margin-bottom: 4px; }
.settings .field input[type="date"], .settings .field input[type="number"] { font: inherit; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--card); color: var(--ink); min-height: 44px; width: 100%; max-width: 320px; }
.settings .field small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.settings .field.row { display: flex; align-items: center; gap: 12px; }
.settings .field.row span { margin: 0; }
.settings .field.row input { width: 32px; height: 32px; }
.settings .danger { margin-top: 30px; padding: 14px; border: 1px solid var(--red); border-radius: var(--radius); }
.settings .danger h3 { margin: 0 0 4px; }
.settings .about { margin-top: 24px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.settings .about h3 { margin: 0 0 4px; }
.settings .about p { margin: 6px 0; font-size: 14px; }
.settings .about a { color: var(--accent-ink); display: inline-flex; align-items: center; min-height: 32px; }

/* ---- effects ---- */
.fx-float { position: absolute; right: 14px; top: -6px; font-weight: 800; color: var(--ok-ink); animation: floatup .9s ease-out forwards; pointer-events: none; }
.feedback { position: relative; }
.fx-shake { animation: reward-shake .45s ease; }
.fx-confetti { position: absolute; top: -12px; width: 7px; height: 12px; border-radius: 2px; animation: fall 3s linear forwards; pointer-events: none; }
@keyframes floatup { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-34px); opacity: 0; } }
@keyframes reward-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes fall { from { transform: translateY(0) rotate(0); } to { transform: translateY(640px) rotate(540deg); } }
.arch .lighthouse.blink .iemoji { animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

@media (prefers-reduced-motion: reduce) {
  .port.cur::after, .port .bubble, .stars3 .star.on, .xpup, .flame.up, .rankcard, .stamp.new .s, .arch .lighthouse.blink .iemoji { animation: none; }
  .arch .boat, .lbar b { transition: none; }
  .fx-float, .fx-shake, .fx-confetti { animation: none; display: none; }
}
@media (max-width: 380px) { .stamps { grid-template-columns: repeat(2, 1fr); } .port { width: 56px; height: 52px; margin-left: -28px; } }

/* ---- the 3D screens (js/scene.js): a canvas, and the labels that float over it as real buttons ---- */
.gl { position: relative; overflow: hidden; }
.gl-canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.gl-labels { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.gl-labels > * { position: absolute; pointer-events: auto; white-space: nowrap; }
.gl-pill {
  transform: translate(-50%, 0); border: none; cursor: pointer; font: inherit; font-size: 11px; font-weight: 800; line-height: 1;
  padding: 6px 9px; border-radius: 10px; background: var(--card); color: var(--ink); box-shadow: 0 2px 6px rgba(0, 30, 60, .3);
}
.gl-pill b { color: var(--amber); margin-left: 4px; letter-spacing: 1px; }
.gl-pill.isl.selected { outline: 2px solid var(--accent); outline-offset: 1px; }
.gl-pill.athens { background: var(--sign); color: var(--sign-ink); border: 1px solid var(--gold-dark); font-size: 12px; padding: 7px 11px; }
.gl-pill.lh { transform: none; }
.gl-pill.lh b { color: var(--bad-ink); }
.gl-pill.lh.blink b { animation: blink 1.6s ease-in-out infinite; }
.gl-map { height: 440px; border-radius: 0 0 22px 22px; }
/* the bay: the canvas, the header and the tour button are fixed; the page scrolls a spacer as long as the bay */
.gl-bay { padding: 0; background: none; border-radius: 0; }
.gl-fixed { position: fixed; left: 0; right: 0; bottom: var(--ad-h, 0px); z-index: 1; }   /* ends above the ad banner's band */
.gl-head { position: fixed; left: 0; right: 0; z-index: 3; padding: 4px 14px 14px; background: linear-gradient(var(--bg) 60%, rgba(0, 0, 0, 0)); pointer-events: none; }
.gl-head .ihead, .gl-head .isub { pointer-events: auto; max-width: 500px; margin-left: auto; margin-right: auto; }
/* as specific as .btn.tour, whose width: 100% would otherwise win and push the button past the right edge */
.btn.tour.gl-tour { position: fixed; left: 16px; right: 16px; bottom: max(12px, env(safe-area-inset-bottom), calc(var(--ad-h, 0px) + 12px)); z-index: 3; width: auto; max-width: 500px; margin: 0 auto; }
.gl-spacer { width: 1px; }
.gl-pill.pt { transform: translate(-50%, -100%); }
.gl-pill.pt .n { display: inline-block; min-width: 10px; text-align: center; }
.gl-pill.lock { color: var(--muted); opacity: .8; box-shadow: none; cursor: default; }
.gl-sign { transform: translate(-50%, -50%); background: var(--sign); color: var(--sign-ink); border: 1px solid var(--gold-dark); border-radius: 10px; padding: 5px 10px; font-size: 11px; font-weight: 800; pointer-events: none; }
.gl-go {
  transform: translate(-50%, -100%); background: var(--ember); color: #fff; border-radius: 10px; padding: 6px 10px; font-size: 12px; font-weight: 900;
  box-shadow: 0 3px 8px rgba(120, 40, 0, .4); pointer-events: none; animation: glbob 1.1s ease-in-out infinite;
}
.gl-go::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--ember); border-bottom: 0; }
.settings .hint3d { display: block; color: var(--muted); font-size: 12px; margin: -8px 0 14px; }
@keyframes glbob { 0%, 100% { transform: translate(-50%, -100%); } 50% { transform: translate(-50%, calc(-100% - 5px)); } }
@media (prefers-reduced-motion: reduce) { .gl-go, .gl-pill.lh.blink b { animation: none; } }

/* ---- study home: the archipelago first, with «Ταξίδεψε» under it, then the daily plan ---- */
#app:has(.home-view) { max-width: 1160px; }
.home-view { padding: 28px 0 0; }
.ui-icon { width: 22px; height: 22px; flex: none; }
.home-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.eyebrow { font-size: 10px; font-weight: 800; letter-spacing: 1.8px; color: var(--muted); margin: 0 0 8px; }
.home-heading h1 { margin: 0; font-size: clamp(26px, 3.2vw, 36px); font-weight: 800; letter-spacing: -1.2px; line-height: 1.25; }
.home-intro { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 1px solid var(--border); border-radius: 13px; background: var(--card); color: var(--ink); cursor: pointer; }
.icon-button:hover { background: var(--accent-soft); border-color: var(--accent); }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(310px, .8fr); gap: 24px; align-items: start; }
.study-panel { min-width: 0; }
.study-card { padding: 27px 26px 0; border: 1px solid var(--border); background: var(--card); border-radius: 22px; overflow: hidden; box-shadow: 0 8px 30px rgba(0, 40, 80, .035); }
.study-kicker { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; font-weight: 700; }
.study-emblem { display: grid; place-items: center; width: 42px; height: 42px; background: var(--amber-soft); color: var(--amber); border-radius: 13px; }
.study-emblem .ui-icon { width: 25px; height: 25px; }
.study-card h2 { font-size: 29px; font-weight: 800; line-height: 1.3; letter-spacing: -.8px; margin: 22px 0 7px; }
.study-detail { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.6; }
.home-view .btn { box-shadow: none; font-weight: 700; }
.home-view .btn:active:not(:disabled) { box-shadow: none; transform: translateY(1px); }
/* the map column: the quiz's sea block (style.css .k-sea, here as tall as the exam's portrait map) and «Ταξίδεψε»,
   the quiz's big button (style.css .k-play), full width right under it; its shadows come back over .home-view .btn */
.map-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.k-sea.exam-sea { height: 490px; }
.exam-sea .arch { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; margin: 0; }   /* the flat map fills the block */
.home-view .travel { width: 100%; margin: 0; box-shadow: 0 6px 0 rgba(90, 30, 5, .8), 0 18px 26px -14px rgba(194, 65, 12, .75); }
.home-view .travel:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 rgba(90, 30, 5, .8); }
.study-start { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; margin: 24px 0; min-height: 51px; font-size: 14px; padding: 13px 16px; }
.study-start .ui-icon { width: 19px; height: 19px; }
.daily-goal { border-top: 1px solid var(--border); padding-top: 20px; }
.goal-heading { display: flex; justify-content: space-between; align-items: center; font-size: 12px; gap: 12px; }
.goal-heading span { color: var(--muted); font-variant-numeric: tabular-nums; }
.goal-track { display: block; background: var(--border); border-radius: 8px; height: 5px; overflow: hidden; margin: 12px 0 10px; }
.goal-track > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.goal-line { margin: 0; font-size: 12px; line-height: 1.65; color: var(--muted); }
.daily-goal .linkish { color: var(--accent-ink); padding-left: 0; }
.study-stats { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; background: var(--bg); border-top: 1px solid var(--border); margin: 20px -26px 0; padding: 8px 20px; font-size: 11px; color: var(--muted); }
.study-stats button { font: inherit; font-weight: 700; border: 0; background: none; color: var(--accent-ink); cursor: pointer; min-height: 40px; padding: 4px 6px; }
.study-stats button:hover { text-decoration: underline; }
.study-shortcuts { display: grid; gap: 10px; margin-top: 16px; }
.study-link { display: flex; align-items: center; gap: 13px; padding: 17px; width: 100%; text-align: left; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--border); border-radius: 16px; cursor: pointer; transition: border-color .15s, background .15s; }
.study-link:hover { border-color: var(--accent); background: var(--accent-soft); }
.shortcut-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; background: var(--accent-soft); color: var(--accent-ink); border-radius: 12px; }
.shortcut-icon.sand { background: var(--amber-soft); color: var(--amber); }
.study-link > span:nth-child(2) { min-width: 0; flex: 1; }
.study-link b { display: block; font-size: 13px; font-weight: 800; }
.study-link small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.study-link > .ui-icon { width: 17px; color: var(--muted); }
.exam-date-link { display: block; font: inherit; font-size: 11px; text-align: center; line-height: 1.6; color: var(--muted); background: none; border: none; width: 100%; min-height: 44px; padding: 14px 8px 0; cursor: pointer; }
.exam-date-link:hover { color: var(--accent-ink); text-decoration: underline; }
.home-view .gl-pill { font-size: 11px; min-height: 32px; display: flex; align-items: center; justify-content: center; padding: 7px 10px; box-shadow: 0 2px 8px rgba(0, 30, 60, .17); }
.home-view .gl-pill.athens { font-size: 11px; }
.home-view .gl-pill.lh { transform: translate(18px, 12px); }
.home-note { color: var(--muted); font-size: 11px; text-align: center; margin: 28px 0 0; }
@media (min-width: 900px) {
  #app:has(.home-view) > .topbar { border-bottom: 1px solid var(--border); padding-bottom: 16px; }
}
@media (max-width: 760px) {
  .home-grid { grid-template-columns: 1fr; gap: 24px; }
  .home-view { padding-top: 18px; }
  .home-heading { margin-bottom: 22px; gap: 12px; }
  .home-heading h1 { font-size: 28px; }
  .home-intro { font-size: 12px; max-width: 260px; line-height: 1.7; margin-top: 6px; }
  .home-heading .eyebrow { font-size: 8px; letter-spacing: 1.4px; }
  .study-card { padding: 22px 22px 0; }
  .study-card h2 { margin-top: 16px; font-size: 27px; }
  .study-start { margin: 20px 0; }
  .study-stats { margin-left: -22px; margin-right: -22px; }
  .study-link { padding: 14px 16px; }
  .k-sea.exam-sea { height: 500px; }
}
@media (prefers-reduced-motion: reduce) {
  .study-link { transition: none; }
}
