@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;700;800&family=Cinzel:wght@600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg: #091612;
  --panel: rgba(13, 27, 21, 0.92);
  --border: rgba(220, 196, 149, 0.35);
  --cream: #fff6e4;
  --muted: #cad5cc;
  --amber: #f8b56d;
  --green: #9bd3a4;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background: linear-gradient(rgba(6, 16, 13, 0.75), rgba(4, 13, 10, 0.92)), url('forest-camp.jpg') center/cover fixed;
  color: var(--cream);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  overflow-x: hidden;
}

button, a { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.skip {
  position: absolute;
  top: -100px;
  left: 0;
  padding: 12px;
  background: white;
  color: black;
  z-index: 99;
}
.skip:focus { top: 0; }

.modes { display: none !important; }
.hero, .seal { display: none !important; }

/* Site Header */
.site-header {
  height: 66px;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: 0;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 25;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font: 800 24px 'Bricolage Grotesque', sans-serif;
  letter-spacing: -0.5px;
  color: #fff6e4;
}

.brand-small {
  display: block;
  font: 700 8.5px 'Plus Jakarta Sans', sans-serif;
  letter-spacing: 1.4px;
  color: #aebbab;
}

.home.quiet, .back-home, a[href="./"]:not(.brand) {
  display: none !important;
}

.round {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff6e4;
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  transition: background 0.2s, border-color 0.2s;
}
.round:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: #e5c98e;
}

/* Main Layout */
main {
  height: 100dvh;
  padding: 0 16px;
  max-width: 960px;
  margin: auto;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Heading */
.game-page-heading {
  position: absolute;
  top: 52px;
  left: 0;
  right: 0;
  text-align: center;
  margin: 0 auto;
  height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
}

.game-page-heading h1 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(22px, 3.2vw, 30px);
  line-height: 1.1;
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff6e4;
  text-shadow: 0 2px 20px #000, 0 2px 4px #000a;
}

.game-page-heading p {
  font-size: 12px;
  color: #eeddbb;
  opacity: 0.85;
  margin: 3px 0 0;
}

.game-page-heading .eyebrow {
  font-size: 8.5px;
  letter-spacing: 0.18em;
  color: #ffcb8b;
  margin-bottom: 2px;
  font-weight: 700;
}

/* Game Stage & Board */
.game {
  padding-top: 130px;
  padding-bottom: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 0;
}

.board-grid {
  width: min(520px, 100%);
  margin: 0 auto;
}

.sheet {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px);
  padding: 16px 18px;
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(220, 196, 149, 0.18);
  margin-bottom: 6px;
}

.sheet-head .eyebrow {
  font-size: 9px;
  letter-spacing: 1.2px;
  color: #ffcb8b;
  font-weight: 700;
}

.scorebox-inline strong {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 17px;
  color: var(--amber);
  font-weight: 800;
}

.scorebox-inline small {
  font-size: 9px;
  color: #cad5cc;
  letter-spacing: 0.5px;
}

.direction {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 9px;
  letter-spacing: 1.6px;
  padding: 5px 2px;
  color: #d3c6a9;
}

.direction span {
  color: #f4b976;
  font-weight: 700;
}

.direction-line {
  flex: 1;
  height: 1px;
  background: rgba(113, 134, 109, 0.35);
}

.direction.bottom {
  margin-top: 3px;
}

#event-list {
  list-style: none;
  margin: 6px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.event-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(22, 42, 32, 0.88);
  border: 1px solid rgba(113, 134, 109, 0.5);
  min-height: 52px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}

.event-card.correct {
  background: rgba(36, 77, 51, 0.9);
  border-color: #8cca95;
}

.event-card.wrong {
  background: rgba(81, 55, 45, 0.9);
  border-color: #d49875;
}

.event-card.dragging {
  opacity: 0.4;
}

.event-card.drop-target {
  outline: 2px solid var(--amber);
}

.position {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(220, 196, 149, 0.5);
  color: #ffe0a6;
  font-weight: 700;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.2);
}

.event-main {
  flex: 1;
  min-width: 0;
}

.event-main strong {
  display: block;
  font-size: 13.5px;
  line-height: 1.25;
  color: #fff6e4;
  font-weight: 600;
}

.event-main small {
  display: block;
  font-size: 10px;
  color: #cad5cc;
  margin-top: 2px;
}

.arrows {
  display: flex;
  gap: 4px;
  flex: none;
}

.arrows button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(117, 141, 118, 0.6);
  background: rgba(29, 48, 35, 0.92);
  color: #fff2d3;
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  transition: background 0.15s;
}

.arrows button:hover:not(:disabled) {
  background: #365741;
  border-color: var(--amber);
}

.arrows button:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

.handle {
  display: none;
}

.primary {
  display: block;
  width: 100%;
  padding: 12px 20px;
  border-radius: 25px;
  border: 0;
  background: linear-gradient(135deg, #e5c98e, #bd985b);
  color: #16271b;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  margin-top: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s, filter 0.15s;
}

.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.status {
  font-size: 10.5px;
  color: var(--muted);
  text-align: center;
  margin: 8px 0 0;
}

/* Results Card */
.finished .board-grid {
  display: none !important;
}

.finished .game-page-heading {
  display: none !important;
}

.result {
  width: min(480px, 94vw);
  margin: 0 auto;
  padding: 18px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px);
  text-align: center;
}

.result .eyebrow {
  font-size: 8.5px;
  letter-spacing: 1.5px;
  color: #ffcb8b;
  font-weight: 700;
}

.result h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 22px;
  line-height: 1.15;
  margin: 4px 0 8px;
  color: #fff6e4;
}

.result .big-score {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 26px;
  color: var(--amber);
  font-weight: 800;
  margin: 6px 0;
}

.result p {
  font-size: 11.5px;
  line-height: 1.45;
  color: #eeddbb;
  margin: 6px auto;
  max-width: 90%;
}

.result ol {
  text-align: left;
  padding-left: 20px;
  font-size: 11.5px;
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result li {
  color: #f4ecdc;
}

.result li strong {
  display: inline;
}

.result li details {
  display: block;
  font-size: 10.5px;
  color: #cad5cc;
  margin-top: 2px;
}

.result details summary {
  cursor: pointer;
  color: #e5c98e;
  font-weight: 600;
}

.result .result-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}

.result button {
  padding: 9px 18px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  border: 0;
  background: linear-gradient(135deg, #e5c98e, #bd985b);
  color: #16271b;
  cursor: pointer;
}

.result button.ghost {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff6e4;
}

footer {
  text-align: center;
  padding: 12px 24px 16px 115px;
  font-size: 10px;
  color: #aebbab;
  opacity: 0.7;
  flex: none;
  margin-top: auto;
  border-top: 1px solid rgba(220, 196, 149, 0.18);
  width: 100%;
  box-sizing: border-box;
}

footer strong {
  font-weight: 700;
}

footer small {
  font-size: 9px;
  letter-spacing: 1px;
}

/* Dialog */
dialog {
  color: var(--cream);
  background: #12221b;
  border: 1px solid var(--border);
  border-radius: 22px;
  width: min(520px, 92vw);
  max-height: 85dvh;
  padding: 22px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
}

dialog::backdrop {
  background: rgba(2, 10, 8, 0.85);
  backdrop-filter: blur(10px);
}

dialog h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 22px;
  margin: 6px 0 12px;
}

dialog p {
  font-size: 13px;
  line-height: 1.5;
  color: #eeddbb;
  margin-bottom: 10px;
}

dialog .home {
  float: right;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 4px 10px;
  color: #eeddbb;
  font-size: 11px;
}

dialog .journal {
  border: 1px solid rgba(220, 196, 149, 0.3);
  background: rgba(0, 0, 0, 0.25);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}

dialog .journal span {
  font-size: 9.5px;
  letter-spacing: 1px;
  color: #ffcb8b;
}

dialog .journal strong {
  font-size: 24px;
  color: var(--amber);
}

/* Mobile responsive */
@media (max-width: 730px) {
  body {
    overflow-y: auto !important;
  }
  main {
    height: auto !important;
    min-height: 100dvh !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
  }
  .site-header {
    padding: 48px 14px 4px !important;
    height: auto !important;
  }
  .brand {
    font-size: 19px !important;
  }
  .brand img {
    width: 24px !important;
    height: 24px !important;
  }
  .brand-small {
    display: none !important;
  }
  .game-page-heading {
    top: 80px !important;
    height: 36px !important;
  }
  .game-page-heading h1 {
    font-size: 16px !important;
    margin: 0 !important;
  }
  .game-page-heading p {
    display: none !important;
  }
  .game-page-heading .eyebrow {
    font-size: 7.5px !important;
    letter-spacing: 0.12em !important;
  }
  .game {
    padding-top: 126px !important;
    padding-bottom: 16px !important;
  }
  .sheet {
    padding: 12px 14px;
  }
  .event-card {
    padding: 6px 10px;
    min-height: 48px;
    gap: 8px;
  }
  .event-main strong {
    font-size: 12px;
    line-height: 1.2;
  }
  .position {
    width: 22px;
    height: 22px;
    font-size: 10px;
  }
  .arrows button {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }
  .primary {
    font-size: 11.5px;
    padding: 10px 16px;
  }
  .result {
    padding: 14px 12px !important;
  }
  .result h2 {
    font-size: 19px !important;
  }
  .result .big-score {
    font-size: 22px !important;
  }
  footer {
    padding: 10px 14px 16px 85px !important;
    font-size: 8.5px !important;
    margin-top: auto !important;
  }
}
