/* Achilles: The Bronze Tide — bronze, ash and wine-dark sea */
:root {
  --ink: #0a0906;
  --ink2: #12100b;
  --panel: rgba(22, 18, 12, .88);
  --bronze: #c9a227;
  --gold: #f3d488;
  --gold-dim: #9c7a2c;
  --wine: #7d1f2a;
  --blood: #a32a2a;
  --sea: #6fb7ae;
  --paper: #efe4cb;
  --muted: #a9997a;
  --line: rgba(201, 162, 39, .26);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: radial-gradient(120% 90% at 50% 0%, #1a150e 0%, #0a0906 55%, #060504 100%);
  color: var(--paper);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  overflow-x: hidden; overflow-y: auto;
}
button { font-family: inherit; cursor: pointer; }
kbd {
  font: 11px/1 ui-monospace, Menlo, monospace; padding: 2px 5px; border-radius: 3px;
  border: 1px solid rgba(243, 212, 136, .35); background: rgba(243, 212, 136, .08); color: var(--gold);
}

#app { position: relative; height: 100vh; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- menu */
#screenMenu { align-items: center; justify-content: center; overflow: hidden; }
#screenMenu::before {
  content: ""; position: absolute; inset: -20%;
  background:
    radial-gradient(60% 50% at 50% 30%, rgba(201, 162, 39, .14), transparent 70%),
    radial-gradient(40% 30% at 80% 80%, rgba(125, 31, 42, .18), transparent 70%);
  animation: breathe 9s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { opacity: .75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.05); } }
.embers { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ember {
  position: absolute; bottom: -10px; width: 2px; height: 2px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 6px 1px rgba(243, 212, 136, .5);
  animation: rise linear infinite; opacity: 0;
}
@keyframes rise {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  12% { opacity: .9; }
  100% { transform: translateY(-105vh) translateX(var(--drift, 20px)); opacity: 0; }
}
.menu-inner { position: relative; text-align: center; padding: 28px 22px; max-width: 640px; z-index: 2; }
.eyebrow {
  font-size: 11px; letter-spacing: .34em; text-transform: uppercase; color: var(--gold-dim);
  margin: 0 0 14px;
}
.brand {
  font-size: clamp(44px, 9vw, 82px); line-height: .92; margin: 0; letter-spacing: .08em;
  font-weight: 500; color: var(--gold);
  text-shadow: 0 1px 0 #4b3a12, 0 0 28px rgba(243, 212, 136, .28);
}
.brand small {
  display: block; margin-top: 12px; font-size: clamp(11px, 1.9vw, 15px);
  letter-spacing: .42em; color: var(--paper); opacity: .82; text-indent: .42em;
}
.rule { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 18px 0; color: var(--gold-dim); }
.rule span { height: 1px; width: min(120px, 22vw); background: linear-gradient(90deg, transparent, var(--line), transparent); }
.rule i { font-style: normal; font-size: 10px; }
.tagline { color: var(--muted); font-size: 14.5px; line-height: 1.7; margin: 0 0 22px; }
.menu-shield { width: 132px; height: 148px; margin: 0 auto 22px; position: relative; }
.menu-shield svg { width: 100%; height: 100%; overflow: visible; }
.shield-pulse { animation: shieldPulse 3.4s ease-in-out infinite; transform-origin: 50% 45%; }
@keyframes shieldPulse { 0%, 100% { filter: drop-shadow(0 0 6px rgba(243, 212, 136, .25)); } 50% { filter: drop-shadow(0 0 18px rgba(243, 212, 136, .55)); } }

.menu-btns { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.btn {
  position: relative; min-width: 268px; padding: 13px 24px; border-radius: 2px;
  border: 1px solid var(--line); background: linear-gradient(180deg, rgba(201, 162, 39, .1), rgba(201, 162, 39, .03));
  color: var(--paper); font-size: 14px; letter-spacing: .14em; text-transform: uppercase;
  transition: transform .18s, border-color .18s, background .18s, color .18s;
  overflow: hidden;
}
.btn::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(243, 212, 136, .22) 50%, transparent 80%);
  transform: translateX(-120%); transition: transform .6s;
}
.btn:hover::after { transform: translateX(120%); }
.btn:hover { border-color: rgba(243, 212, 136, .6); transform: translateY(-1px); }
.btn.primary {
  border-color: rgba(243, 212, 136, .55);
  background: linear-gradient(180deg, #d9b24e, #a87f22);
  color: #1a1305; font-weight: 700;
  box-shadow: 0 6px 22px rgba(201, 162, 39, .22), inset 0 1px 0 rgba(255, 244, 210, .5);
}
.btn.primary:hover { background: linear-gradient(180deg, #f0cb6c, #b98c27); }
.btn.ghost { min-width: 0; padding: 9px 16px; font-size: 12px; }
.menu-best { margin: 18px 0 6px; font-size: 12px; color: var(--gold-dim); letter-spacing: .08em; min-height: 16px; }
.menu-hint { font-size: 11.5px; color: #6f6350; letter-spacing: .04em; }
.menu-foot {
  position: absolute; bottom: 16px; left: 0; right: 0; text-align: center;
  font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: #5d5241;
}

/* ------------------------------------------------------------ chapters */
#screenChapters { padding: 22px clamp(14px, 4vw, 54px) 16px; overflow: hidden; }
.map-head { text-align: center; flex: 0 0 auto; }
.map-head h2 { font-size: clamp(24px, 3.4vw, 34px); margin: 2px 0 0; letter-spacing: .1em; color: var(--gold); font-weight: 500; }
.rule.small { margin: 10px 0 4px; }
.map-scroll { flex: 1 1 auto; overflow-y: auto; padding: 6px 2px 8px; }
.act-block { margin: 0 auto 18px; max-width: 1060px; }
.act-head { display: flex; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 12px; }
.act-head b { font-size: 12px; letter-spacing: .3em; color: var(--gold-dim); font-weight: 500; }
.act-head h3 { margin: 0; font-size: 19px; letter-spacing: .06em; color: var(--paper); font-weight: 500; }
.act-head em { font-size: 12px; color: var(--muted); font-style: italic; margin-left: auto; }
.chapter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.ch {
  position: relative; aspect-ratio: 1 / .82; border: 1px solid var(--line); background: rgba(20, 16, 11, .7);
  color: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  transition: transform .16s, border-color .16s, background .16s; padding: 4px;
}
.ch:hover { transform: translateY(-2px); border-color: rgba(243, 212, 136, .55); background: rgba(201, 162, 39, .1); }
.ch b { font-size: 18px; font-weight: 500; color: var(--gold); }
.ch small { font-size: 9px; letter-spacing: .06em; color: #7d7059; text-transform: uppercase; text-align: center; line-height: 1.15; }
.ch .stars { font-size: 9px; letter-spacing: 1px; color: var(--bronze); }
.ch.locked { opacity: .34; cursor: not-allowed; }
.ch.locked:hover { transform: none; }
.ch.boss { border-color: rgba(163, 42, 42, .55); }
.ch.boss b { color: #e9b07a; }
.ch.cleared::after {
  content: ""; position: absolute; inset: 4px; border: 1px solid rgba(243, 212, 136, .18); pointer-events: none;
}
.map-foot { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--line); }
.map-stars { font-size: 12px; color: var(--gold-dim); letter-spacing: .1em; margin: 0; }

/* ---------------------------------------------------------------- game */
#screenGame { background: #080705; }
.hud {
  flex: 0 0 auto; display: flex; align-items: center; gap: 14px;
  padding: max(8px, env(safe-area-inset-top)) 14px 8px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18, 15, 10, .96), rgba(10, 9, 6, .9));
  z-index: 4;
}
.hud-left { display: flex; flex-direction: column; min-width: 120px; }
.hud-act { font-size: 9.5px; letter-spacing: .28em; color: var(--gold-dim); text-transform: uppercase; }
.hud-name { font-size: 13px; letter-spacing: .04em; color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw; }
.hud-mid { flex: 1 1 auto; display: flex; flex-direction: column; gap: 4px; }
.bar { position: relative; height: 7px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .06); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; transition: width .18s; }
#hudHp > i { background: linear-gradient(90deg, #7d1f2a, #d3544a); box-shadow: 0 0 12px rgba(211, 84, 74, .5); }
#hudXp > i { background: linear-gradient(90deg, #8a6a1f, #f3d488); }
.bar.xp { height: 4px; }
.hud-row { display: flex; align-items: center; gap: 10px; font-size: 10.5px; color: var(--muted); letter-spacing: .06em; }
.hud-row b { color: var(--gold); font-weight: 500; }
.hud-right { display: flex; align-items: center; gap: 8px; }
.hud-stat { display: flex; flex-direction: column; align-items: flex-end; font-size: 10px; color: #7d7059; letter-spacing: .1em; }
.hud-stat b { font-size: 14px; color: var(--paper); font-weight: 500; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.icon-btn {
  width: 32px; height: 32px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03);
  color: var(--gold); font-size: 13px; border-radius: 2px; transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: rgba(201, 162, 39, .14); border-color: rgba(243, 212, 136, .5); }

.stage {
  position: relative; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center;
  padding: 8px; overflow: hidden;
}
#board { display: block; max-width: 100%; max-height: 100%; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); touch-action: none; }
.stage::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(80% 70% at 50% 50%, transparent 55%, rgba(0, 0, 0, .45));
}

.foot {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 8px 14px max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: rgba(10, 9, 6, .95);
}
.ability {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .02); border-radius: 2px; color: var(--paper); font-size: 11px;
  letter-spacing: .12em; text-transform: uppercase;
}
.ability .ico { font-size: 15px; color: var(--gold); }
.ability .cd { position: relative; width: 52px; height: 4px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.ability .cd > i { position: absolute; inset: 0; width: 0; background: var(--gold); }
.ability.ready { border-color: rgba(243, 212, 136, .5); box-shadow: 0 0 14px rgba(201, 162, 39, .14); }
.foot-hint { font-size: 11px; color: #6f6350; letter-spacing: .05em; }

/* boss bar */
.bossbar {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: min(460px, 72%); z-index: 3; text-align: center; pointer-events: none;
}
.bossbar b { display: block; font-size: 10.5px; letter-spacing: .3em; color: #e9b07a; text-transform: uppercase; margin-bottom: 4px; text-shadow: 0 2px 8px #000; }
.bossbar .bar { height: 8px; border-color: rgba(163, 42, 42, .5); background: rgba(0, 0, 0, .6); }
.bossbar .bar > i { background: linear-gradient(90deg, #7d1f2a, #e0634e); width: 100%; }

/* toasts */
#toast {
  position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 6px; align-items: center; z-index: 6; pointer-events: none;
}
.toast-item {
  padding: 7px 16px; background: rgba(10, 8, 5, .9); border: 1px solid var(--line);
  color: var(--gold); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  animation: toastIn .25s ease-out, toastOut .4s ease-in 1.5s forwards;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

/* -------------------------------------------------------------- modals */
.modal {
  position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(60% 60% at 50% 45%, rgba(12, 10, 7, .82), rgba(5, 4, 3, .96));
  padding: 18px; backdrop-filter: blur(3px);
}
.modal-box {
  width: min(560px, 96vw); max-height: 92vh; overflow-y: auto;
  border: 1px solid rgba(201, 162, 39, .38); background: linear-gradient(180deg, rgba(28, 22, 14, .98), rgba(14, 12, 8, .99));
  padding: 26px 26px 22px; text-align: center; position: relative;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(243, 212, 136, .1);
  animation: modalIn .28s ease-out;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.modal-box::before { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(201, 162, 39, .12); pointer-events: none; }
.modal-act { font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold-dim); margin: 0 0 8px; }
.modal-box h3 { font-size: 26px; letter-spacing: .04em; margin: 0 0 12px; color: var(--gold); font-weight: 500; }
.modal-story { font-size: 14px; line-height: 1.75; color: #d9cdb4; margin: 0 0 12px; text-align: left; }
.modal-tip { font-size: 12px; line-height: 1.6; color: var(--muted); border-left: 2px solid var(--line); padding-left: 10px; text-align: left; margin: 0 0 18px; }
.modal-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 6px; }
.modal-btns .btn { min-width: 150px; }

.stars { display: flex; gap: 10px; justify-content: center; margin: 6px 0 12px; font-size: 30px; color: #3a3122; }
.stars i { font-style: normal; transition: color .4s, text-shadow .4s; }
.stars i.on { color: var(--gold); text-shadow: 0 0 18px rgba(243, 212, 136, .55); }
.stars.pop i.on { animation: starPop .5s cubic-bezier(.2,1.6,.4,1) both; }
.stars.pop i.on:nth-child(2) { animation-delay: .12s; }
.stars.pop i.on:nth-child(3) { animation-delay: .24s; }
@keyframes starPop { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.res-line { margin: 3px 0; font-size: 13px; color: var(--muted); letter-spacing: .06em; }
.res-best { margin: 10px 0 0; font-size: 12px; color: var(--gold-dim); letter-spacing: .1em; }

/* draft */
#modalDraft .modal-box { width: min(760px, 96vw); }
.draft-sub { font-size: 12px; color: var(--muted); margin: 0 0 16px; letter-spacing: .06em; }
.draft-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.card {
  text-align: left; padding: 14px 12px 12px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(201, 162, 39, .09), rgba(255, 255, 255, .015));
  color: var(--paper); position: relative; transition: transform .16s, border-color .16s, box-shadow .16s;
  min-height: 168px; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); border-color: rgba(243, 212, 136, .65); box-shadow: 0 12px 30px rgba(0, 0, 0, .45); }
.card .god { font-size: 9.5px; letter-spacing: .28em; text-transform: uppercase; color: var(--gold-dim); }
.card .nm { font-size: 17px; margin: 6px 0 8px; color: var(--gold); line-height: 1.2; }
.card .ds { font-size: 12px; line-height: 1.55; color: #cdc0a6; flex: 1 1 auto; }
.card .rk { font-size: 9.5px; color: var(--muted); letter-spacing: .14em; margin-top: 8px; }
.card .pips { display: flex; gap: 3px; margin-top: 6px; }
.card .pips i { width: 100%; height: 3px; background: rgba(255, 255, 255, .12); }
.card .pips i.on { background: var(--bronze); }
.card .key { position: absolute; top: 8px; right: 9px; font-size: 9px; color: #5f5543; letter-spacing: .1em; }

/* mobile */
@media (max-width: 760px) {
  .hud { gap: 8px; padding: 6px 8px; }
  .hud-left { min-width: 74px; }
  .hud-name { font-size: 11px; max-width: 26vw; }
  .hud-stat:nth-child(1) { display: none; }
  .hud-right .icon-btn { width: 28px; height: 28px; }
  .foot { gap: 8px; padding: 6px 8px max(6px, env(safe-area-inset-bottom)); }
  .foot-hint { display: none; }
  .ability { padding: 5px 8px; font-size: 9.5px; gap: 5px; }
  .ability .cd { width: 34px; }
  .draft-grid { grid-template-columns: 1fr; gap: 7px; }
  .card { min-height: 0; padding: 10px; }
  .card .nm { font-size: 15px; margin: 3px 0 5px; }
  .card .ds { font-size: 11.5px; }
  #modalDraft .modal-box { padding: 16px; }
  .modal-box { padding: 20px 16px; }
  .modal-box h3 { font-size: 21px; }
  .modal-story { font-size: 13px; }
  .chapter-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
  .ch b { font-size: 15px; }
  .ch small { font-size: 8px; }
  .btn { min-width: 0; width: 100%; }
  .modal-btns .btn { min-width: 0; flex: 1 1 40%; }
}
@media (max-height: 560px) {
  .menu-shield { display: none; }
  .brand { font-size: 40px; }
  .tagline { margin-bottom: 12px; }
}

/* --------------------------------------------------------- prose below */
.seo {
  position: absolute; left: 0; right: 0; top: 100%; background: #0b0a07;
  padding: 40px clamp(18px, 6vw, 90px) 60px; color: #cfc3aa; font-size: 15px; line-height: 1.8;
}
.seo h2 { color: var(--gold); font-weight: 500; letter-spacing: .04em; font-size: 24px; margin: 28px 0 8px; }
.seo h3 { color: var(--paper); font-size: 16px; margin: 18px 0 4px; font-weight: 500; }
.seo p, .seo li { color: #b9ad96; }
.seo table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.seo th, .seo td { text-align: left; padding: 7px 9px; border-bottom: 1px solid rgba(201, 162, 39, .16); vertical-align: top; }
.seo th { color: var(--gold-dim); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.seo code { color: var(--gold); font-size: 13px; }
