﻿@font-face {
  font-family: "Kargo Sans";
  src: url("./assets/fonts/IFKargoSans-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Kargo Sans";
  src: url("./assets/fonts/IFKargoSans-Semibold.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Kargo Sans";
  src: url("./assets/fonts/IFKargoSans-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Kargo Sans";
  src: url("./assets/fonts/IFKargoSans-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Kargo Sans";
  src: url("./assets/fonts/IFKargoSans-Extrabold.woff") format("woff");
  font-weight: 800 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #181714;
  --muted: rgba(24, 23, 20, 0.68);
  --panel: rgba(255, 255, 255, 0.72);
  --panel-strong: rgba(255, 255, 255, 0.9);
  --line: rgba(82, 72, 60, 0.18);
  --copper: #d4954d;
  --amber: #ffc46e;
  --blue: #9ac8df;
  --danger: #e36b4a;
  --font-latin: "Kargo Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font-latin);
}

* {
  box-sizing: border-box;
}

html,
body,
#experience {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background:
    radial-gradient(circle at 58% 42%, rgba(255, 255, 255, 0.98), transparent 38%),
    linear-gradient(180deg, #f7f7f4 0%, #dedfdc 100%);
  color: var(--ink);
}

button,
input,
summary {
  font: inherit;
}

button,
summary {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.loading-overlay,
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  align-items: center;
  justify-items: start;
  padding: clamp(20px, 6vw, 82px);
  background:
    linear-gradient(90deg, rgba(247, 247, 244, 0.9), rgba(247, 247, 244, 0.28) 58%, rgba(247, 247, 244, 0.04)),
    radial-gradient(circle at 58% 44%, rgba(255, 255, 255, 0.86), transparent 34%);
}

.loading-overlay[hidden],
.intro-overlay[hidden] {
  display: none !important;
}

.loading-card,
.intro-overlay > * {
  max-width: 680px;
}

.loading-card {
  width: min(420px, calc(100vw - 40px));
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  backdrop-filter: blur(18px);
}

.loading-card strong,
.kicker,
.stage-panel > span,
.game-panel span,
.source-note strong,
.result-panel span {
  color: var(--copper);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.loading-track {
  display: block;
  height: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
}

.loading-track i {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0.04);
  transform-origin: left;
  background: linear-gradient(90deg, var(--copper), var(--amber), var(--blue));
}

#errorText {
  display: block;
  margin-top: 10px;
  color: #ffd4c4;
}

.intro-overlay h1 {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: clamp(4.2rem, 12vw, 11rem);
  font-weight: 400;
  line-height: 0.82;
  letter-spacing: 0;
}

.intro-line {
  margin: 20px 0 0;
  color: var(--ink);
  font-size: clamp(1.3rem, 3vw, 2.5rem);
}

.intro-copy,
.top-title p,
.stage-panel p,
.game-panel p,
.source-note p,
.simple-description p,
.result-panel p {
  color: var(--muted);
  line-height: 1.5;
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(14, 18, 23, 0.62);
  color: #fff8ef;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

button:hover,
button[aria-pressed="true"] {
  border-color: rgba(255, 196, 110, 0.78);
  background: rgba(156, 92, 38, 0.72);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.06);
}

.top-title {
  position: fixed;
  top: clamp(16px, 3vw, 34px);
  left: clamp(14px, 3vw, 42px);
  z-index: 5;
  width: min(340px, calc(100vw - 28px));
  pointer-events: none;
}

.top-title h2 {
  max-width: 18ch;
  margin: 6px 0 0;
  font-size: clamp(1.3rem, 2.8vw, 2.6rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0;
}

.top-title p:not(.kicker) {
  display: none;
  max-width: 36rem;
  margin: 12px 0 0;
}

.stage-panel,
.view-tabs,
.control-dock,
.result-panel,
.challenge-banner,
.challenge-dialog,
.sound-button,
.lang-button,
.exhibits-button,
.debug-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 60px rgba(45, 39, 32, 0.12);
}

.stage-panel {
  position: fixed;
  top: clamp(16px, 3vw, 34px);
  right: clamp(14px, 3vw, 42px);
  z-index: 5;
  width: min(340px, calc(100vw - 28px));
  padding: 16px;
  display: none;
}

.stage-panel strong,
.result-panel strong {
  display: block;
  margin-top: 8px;
  font-size: 1.28rem;
}

.stage-panel p {
  min-height: 58px;
  margin: 8px 0 14px;
  font-size: 0.92rem;
}

.meter-grid {
  display: grid;
  gap: 9px;
}

.meter-grid div {
  display: grid;
  gap: 5px;
}

.meter-grid small {
  display: flex;
  justify-content: space-between;
  color: rgba(24, 23, 20, 0.66);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.meter-grid b {
  color: var(--ink);
  font-weight: 400;
}

.meter-grid i {
  position: relative;
  display: block;
  height: 5px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

.meter-grid i::before {
  position: absolute;
  inset: 0;
  width: var(--value, 0%);
  background: linear-gradient(90deg, #9a4628, var(--amber), var(--blue));
  content: "";
}

.view-tabs {
  position: fixed;
  left: 50%;
  top: auto;
  bottom: clamp(88px, 10vw, 118px);
  z-index: 12;
  display: none;
  transform: translateX(-50%);
}

.view-tabs button {
  border-width: 0 1px 0 0;
  border-radius: 0;
  background: transparent;
}

.view-tabs button:first-child {
  border-left-width: 0;
}

.control-dock {
  position: fixed;
  right: auto;
  bottom: clamp(16px, 3vw, 34px);
  left: 50%;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: translateX(-50%);
  backdrop-filter: none;
}

.control-dock label {
  display: none;
  gap: 7px;
  width: 178px;
  padding: 10px 12px;
  border: 1px solid rgba(120, 88, 52, 0.22);
  background: rgba(255, 255, 255, 0.78);
  color: rgba(24, 23, 20, 0.72);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  box-shadow: 0 14px 42px rgba(45, 39, 32, 0.1);
  backdrop-filter: blur(14px);
}

.heat-button {
  position: relative;
  width: 116px;
  min-width: 116px;
  height: 116px;
  min-height: 116px;
  padding: 0 14px;
  border: 1px solid rgba(124, 70, 32, 0.46);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 252, 240, 0.96) 0 46%, transparent 47%),
    conic-gradient(from -90deg, var(--pressure-color, #5ca8c8) var(--pressure, 0%), rgba(126, 97, 68, 0.2) 0);
  color: #221812;
  font-weight: 600;
  box-shadow:
    0 18px 52px rgba(81, 56, 34, 0.2),
    inset 0 0 0 8px rgba(255, 255, 255, 0.55);
}

.heat-button[aria-pressed="true"] {
  border-color: rgba(166, 82, 36, 0.72);
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 248, 230, 0.98) 0 43%, transparent 44%),
    conic-gradient(from -90deg, var(--pressure-color, #ab4f27) var(--pressure, 0%), rgba(126, 97, 68, 0.2) 0);
  color: #24140d;
}

.heat-button:hover {
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 250, 235, 0.98) 0 43%, transparent 44%),
    conic-gradient(from -90deg, var(--pressure-color, #c16d35) var(--pressure, 0%), rgba(126, 97, 68, 0.24) 0);
}

#experience[data-mode="heating"] .heat-button {
  width: 132px;
  min-width: 132px;
  height: 132px;
  min-height: 132px;
  color: #fff8ef;
  text-shadow: 0 1px 5px rgba(40, 12, 0, 0.5);
}

#releaseBtn {
  display: none;
  background: rgba(24, 23, 20, 0.72);
  color: #fff8ef;
}

input[type="range"] {
  width: 100%;
  height: 22px;
  appearance: none;
  background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  border: 1px solid rgba(120, 88, 52, 0.22);
  background: linear-gradient(90deg, #294458, #9b5a2f, var(--amber), #f4ecda);
}

input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -7px;
  appearance: none;
  border: 1px solid rgba(255, 237, 201, 0.7);
  border-radius: 50%;
  background: #f8e4bf;
}

input[type="range"]::-moz-range-track {
  height: 5px;
  border: 1px solid rgba(120, 88, 52, 0.22);
  background: linear-gradient(90deg, #294458, #9b5a2f, var(--amber), #f4ecda);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 237, 201, 0.7);
  border-radius: 50%;
  background: #f8e4bf;
}

.game-panel {
  display: none;
}

.game-panel strong {
  display: block;
  margin-top: 7px;
  color: var(--blue);
}

.game-panel p,
.source-note p {
  margin: 9px 0 0;
  font-size: 0.82rem;
}

.aim-hint {
  position: fixed;
  left: 50%;
  bottom: clamp(142px, 15vh, 178px);
  z-index: 9;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(35, 29, 22, 0.7);
  font-size: 0.78rem;
  font-weight: 600;
  text-shadow: 0 1px 8px rgba(255, 255, 255, 0.92);
  transform: translateX(-50%);
  pointer-events: none;
}

.aim-hint[hidden] {
  display: none;
}

.angle-sketch {
  --launch-angle: -43deg;
  position: fixed;
  right: clamp(118px, 15vw, 260px);
  top: 50%;
  z-index: 9;
  width: 148px;
  height: 112px;
  color: rgba(32, 27, 22, 0.82);
  font-family: var(--font-latin);
  pointer-events: none;
  transform: translateY(-12%);
}

html[lang="el"] .angle-sketch,
html[lang="el"] .sound-button,
html[lang="el"] .exhibits-button,
html[lang="el"] .heat-button,
html[lang="el"] .result-panel,
html[lang="el"] .challenge-dialog,
html[lang="el"] .challenge-banner,
html[lang="el"] .top-title {
  font-family: var(--font-latin);
}

.angle-sketch span {
  position: absolute;
  right: 0;
  top: 0;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  text-shadow: 0 1px 8px rgba(255, 255, 255, 0.94);
}

.angle-sketch::before {
  position: absolute;
  right: 6px;
  bottom: 20px;
  width: 112px;
  height: 2px;
  background: rgba(146, 100, 48, 0.48);
  content: "";
}

.angle-sketch i {
  position: absolute;
  right: 6px;
  bottom: 20px;
  width: 112px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(173, 111, 48, 0.95), rgba(173, 111, 48, 0.2));
  transform: rotate(calc(var(--launch-angle) + 180deg));
  transform-origin: right center;
}

.angle-sketch i::after {
  position: absolute;
  left: -4px;
  top: 50%;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 14px solid rgba(173, 111, 48, 0.95);
  content: "";
  transform: translateY(-50%);
}

.angle-sketch[hidden] {
  display: none;
}

.challenge-banner {
  position: fixed;
  right: clamp(14px, 3vw, 42px);
  top: 376px;
  z-index: 7;
  min-width: 156px;
  padding: 10px 12px;
  color: #25211b;
  background: rgba(255, 255, 255, 0.9);
  text-align: left;
}

.challenge-banner[hidden] {
  display: none;
}

.challenge-banner span {
  display: block;
  color: var(--copper);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
}

.challenge-banner strong {
  display: block;
  margin-top: 3px;
  font-size: 0.95rem;
}

.challenge-dialog {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 24;
  width: min(430px, calc(100vw - 28px));
  padding: 16px;
  transform: translateX(-50%);
  color: #25211b;
  background: rgba(255, 255, 255, 0.94);
}

.challenge-dialog[hidden] {
  display: none;
}

.challenge-dialog strong {
  display: block;
  margin-bottom: 10px;
  font-size: 1.18rem;
}

.challenge-dialog input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(121, 92, 54, 0.38);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.86);
  color: #25211b;
  font: inherit;
}

.challenge-dialog div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.source-note,
.simple-description {
  display: none;
}

.source-note {
  bottom: clamp(104px, 13vh, 130px);
}

.source-note a {
  color: var(--amber);
}

.simple-description {
  bottom: clamp(198px, 24vh, 230px);
}

.simple-description summary {
  color: var(--ink);
}

.result-panel {
  position: fixed;
  left: clamp(18px, 3vw, 42px);
  right: auto;
  bottom: clamp(18px, 4vh, 42px);
  z-index: 16;
  width: min(360px, calc(100vw - 28px));
  padding: 14px 16px;
  transform: none;
}

.result-panel[hidden] {
  display: none;
}

.result-panel ul {
  margin: 8px 0 12px;
  padding-left: 18px;
  color: var(--muted);
}

.score-meter {
  position: relative;
  width: 100%;
  height: 8px;
  margin: 10px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(77, 67, 56, 0.12);
}

.score-meter i {
  display: block;
  width: var(--score, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--score-color, #c47a2e), rgba(255, 211, 130, 0.92));
  transition: width 260ms ease;
}

.result-panel > div:not(.score-meter) {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.result-panel[data-score-tone="excellent"] {
  border-color: rgba(77, 143, 86, 0.55);
  box-shadow: 0 18px 62px rgba(77, 143, 86, 0.18);
}

.result-panel[data-score-tone="excellent"] #resultScore {
  color: #2f8b47;
}

.result-panel[data-score-tone="partial"] {
  border-color: rgba(198, 126, 38, 0.58);
  box-shadow: 0 18px 62px rgba(198, 126, 38, 0.16);
}

.result-panel[data-score-tone="partial"] #resultScore {
  color: #a36324;
}

.result-panel[data-score-tone="miss"] {
  border-color: rgba(196, 63, 43, 0.5);
}

.result-panel[data-score-tone="miss"] #resultScore {
  color: #b43d2e;
}

#experience[data-mode="result"] .result-panel {
  left: 50%;
  bottom: 18px;
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  transform: translateX(-50%);
}

#experience[data-mode="result"] .result-panel > span,
#experience[data-mode="result"] .result-panel > strong,
#experience[data-mode="result"] .result-panel > p,
#experience[data-mode="result"] .result-panel > ul,
#experience[data-mode="result"] .score-meter {
  display: none;
}

#experience[data-mode="result"] .result-panel > div:not(.score-meter) {
  justify-content: center;
}

#experience[data-mode="result"] .result-panel button {
  min-width: 184px;
  min-height: 58px;
  padding: 17px 26px;
  border-color: rgba(62, 48, 34, 0.32);
  background: rgba(28, 24, 20, 0.86);
  color: #fffaf0;
  font-size: 1.08rem;
  font-weight: 700;
  box-shadow: 0 18px 48px rgba(45, 39, 32, 0.24);
}

.sound-button {
  position: fixed;
  right: clamp(14px, 3vw, 42px);
  top: 208px;
  z-index: 7;
}

.lang-button,
.exhibits-button {
  position: fixed;
  right: clamp(14px, 3vw, 42px);
  z-index: 7;
}

.lang-button {
  top: 264px;
  min-width: 58px;
}

.exhibits-button {
  top: 320px;
}

.sound-button,
.lang-button,
.exhibits-button {
  border-color: rgba(121, 92, 54, 0.38);
  background: rgba(255, 255, 255, 0.9);
  color: #25211b;
  text-shadow: none;
}

.sound-button:hover,
.sound-button:focus-visible,
.lang-button:hover,
.lang-button:focus-visible,
.exhibits-button:hover,
.exhibits-button:focus-visible {
  border-color: rgba(148, 91, 38, 0.72);
  background: rgba(244, 232, 211, 0.96);
  color: #201a14;
}

.labels-layer {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
}

.hotspot-label {
  display: none;
}

.hotspot-label strong,
.hotspot-label span {
  display: block;
}

.hotspot-label strong {
  color: var(--amber);
}

.hotspot-label span {
  color: rgba(247, 239, 226, 0.72);
  margin-top: 3px;
}

.debug-panel {
  position: fixed;
  left: 14px;
  top: 14px;
  z-index: 30;
  max-width: 340px;
  padding: 12px;
  color: #bdfad7;
  font-size: 12px;
  white-space: pre-wrap;
}

#experience[data-mode="intro"] .top-title,
#experience[data-mode="intro"] .stage-panel,
#experience[data-mode="intro"] .view-tabs,
#experience[data-mode="intro"] .control-dock,
#experience[data-mode="intro"] .game-panel,
#experience[data-mode="intro"] .source-note,
#experience[data-mode="intro"] .simple-description,
#experience[data-mode="intro"] .sound-button,
.intro-overlay {
  opacity: 0;
  pointer-events: none;
}

#experience[data-mode="flight"] .control-dock,
#experience[data-mode="result"] .control-dock {
  opacity: 0;
  pointer-events: none;
}

#experience[data-mode="heating"] .control-dock,
#experience[data-mode="aiming"] .control-dock {
  width: auto;
}

#experience[data-mode="heating"] .control-dock label:nth-of-type(2),
#experience[data-mode="aiming"] .control-dock label:nth-of-type(2) {
  display: none;
  min-width: 150px;
}

#experience[data-mode="heating"] #releaseBtn,
#experience[data-mode="aiming"] #releaseBtn {
  display: none;
}

@media (max-width: 1060px) {
  .view-tabs {
    top: auto;
    bottom: 94px;
  }

  .source-note,
  .simple-description {
    display: none;
  }
}

@media (max-width: 760px) {
  .top-title {
    width: calc(100vw - 28px);
  }

  .top-title h2 {
    max-width: 18ch;
    font-size: clamp(1.65rem, 8vw, 2.8rem);
  }

  .top-title p:not(.kicker) {
    display: none;
  }

  .stage-panel {
    top: 112px;
    right: 14px;
    width: min(280px, calc(100vw - 28px));
    padding: 12px;
  }

  .stage-panel p {
    min-height: 0;
    font-size: 0.78rem;
  }

  .meter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .game-panel {
    display: none;
  }

  .control-dock {
    gap: 10px;
  }

  .control-dock button,
  .control-dock label {
    min-width: 0;
  }

  .view-tabs {
    display: none !important;
  }

  .view-tabs button {
    min-height: 36px;
    padding: 0 8px;
    font-size: 0.82rem;
  }

  .sound-button {
    top: 12px;
    right: 14px;
    bottom: auto;
  }

  .lang-button {
    top: 62px;
    right: 14px;
    bottom: auto;
  }

  .exhibits-button {
    top: 112px;
    right: 14px;
    bottom: auto;
  }

  .challenge-banner {
    top: 160px;
    right: 14px;
    min-width: 132px;
    padding: 9px 10px;
  }

  .result-panel {
    left: 14px;
    right: auto;
    bottom: 14px;
    width: min(330px, calc(100vw - 28px));
    padding: 12px;
  }
}

@media (max-width: 520px) {
  .intro-overlay {
    align-items: end;
    padding: 16px;
  }

  .intro-overlay h1 {
    font-size: clamp(3.2rem, 18vw, 5rem);
  }

  .intro-actions {
    display: grid;
  }

  .stage-panel {
    display: none;
  }

  .control-dock {
    right: auto;
    bottom: 10px;
    left: 50%;
    width: calc(100vw - 20px);
    justify-content: center;
    padding: 0;
  }

  .control-dock label span {
    font-size: 0.65rem;
  }

  .heat-button,
  #releaseBtn {
    grid-column: auto;
  }

  .view-tabs {
    display: none !important;
  }

  .sound-button {
    top: 10px;
    bottom: auto;
  }

  .lang-button {
    top: 58px;
    bottom: auto;
  }

  .exhibits-button {
    top: 106px;
    bottom: auto;
  }

  .challenge-banner {
    top: 154px;
    right: 10px;
  }

  .result-panel {
    width: calc(100vw - 20px);
    max-height: 38vh;
    overflow: auto;
  }

  .hotspot-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
