/* Aikamatkan yhteinen tyyli. Muodot ovat epäsäännöllisiä (talon sääntö:
 * ei suorakaiteita) — siksi kulmat ovat epäsymmetrisiä soikioita. */
:root {
  --yo: #12161f;
  --yo2: #1b2130;
  --messinki: #d6a24a;
  --messinki2: #f0c878;
  --pergamentti: #efe3c8;
  --muste: #2b2116;
  --teksti: #eee6d6;
  --himmea: #a99f8c;
  --talo: #d6a24a;          /* talon oma väri, sivu asettaa */
  --talo-tausta: #12161f;
  --muoto1: 28px 20px 32px 16px / 18px 30px 20px 28px;
  --muoto2: 20px 30px 18px 26px / 26px 18px 30px 20px;
  --otsikko: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; background: var(--talo-tausta); color: var(--teksti);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
body {
  min-height: 100vh; min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 10px) calc(env(safe-area-inset-right) + 16px)
           calc(env(safe-area-inset-bottom) + 24px) calc(env(safe-area-inset-left) + 16px);
}
a { color: var(--messinki2); }
h1, h2, h3 { font-family: var(--otsikko); font-weight: 700; line-height: 1.15; }

/* Paluunappi: kotinäyttösovelluksessa ainoa ulospääsy. */
a.am-paluu {
  width: 40px; height: 40px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; color: var(--teksti); font: 700 26px/1 system-ui, sans-serif;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  border-radius: 52% 48% 55% 45% / 48% 55% 45% 52%; position: relative; z-index: 9000;
}
a.am-paluu span { transform: translateY(-2px); }
a.am-paluu:active { transform: scale(.92); }

.am-yla { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.am-yla h1 { font-size: 19px; margin: 0; flex: 1; min-width: 0; }

.am-nappi {
  display: inline-block; font: 700 16px system-ui, sans-serif; color: var(--muste);
  background: var(--talo); border: 0; padding: 12px 24px; cursor: pointer; text-decoration: none;
  border-radius: var(--muoto2); box-shadow: 0 3px 0 rgba(0,0,0,.35);
}
.am-nappi:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.am-nappi.toissijainen { background: rgba(255,255,255,.1); color: var(--teksti); box-shadow: none; }
.am-nappi[disabled] { opacity: .45; }

.am-kortti {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--muoto1); padding: 16px;
}

.am-pieni { font-size: 13px; color: var(--himmea); }
[hidden] { display: none !important; }
