:root {
  color-scheme: dark;
  --bg: #020202;
  --panel: #070807;
  --panel-2: #0d0c09;
  --line: #8c681c;
  --line-soft: #2f250d;
  --gold: #d8ad32;
  --gold-2: #e5be62;
  --text: #f2e6c8;
  --muted: #b8b8b8;
  --red: #ff416b;
  --green: #2ddf76;
  --blue: #4aa3ff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.app {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #050504;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.brand-card {
  margin-top: 18px;
  height: 300px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #080704;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.brand-card img {
  max-width: 100%;
  max-height: 285px;
  object-fit: contain;
}

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--gold-2);
  letter-spacing: 4px;
  margin: 0;
}

h1 {
  text-align: center;
  font-size: 25px;
}

.motto {
  color: #a77c18;
  text-align: center;
  font-size: 11px;
  letter-spacing: 3px;
  margin: 0 0 12px;
}

nav {
  display: grid;
  gap: 9px;
  flex: 1;
  align-content: start;
}

.nav-btn, .ghost, .gold, .danger {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 12px 14px;
  background: #080704;
  color: var(--text);
  font-weight: 700;
}

.nav-btn {
  text-align: left;
}

.nav-btn:hover, .nav-btn.active {
  border-color: var(--gold);
  background: #1a1305;
  color: white;
}

.gold {
  background: var(--gold);
  color: white;
  border-color: var(--gold);
}

.danger {
  background: #271018;
  border-color: #743144;
  color: #ffc6d2;
}

.ghost:hover, .gold:hover, .danger:hover { filter: brightness(1.08); }

.session-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

main {
  min-width: 0;
  display: grid;
  grid-template-rows: 86px minmax(0, 1fr);
}

header {
  border-bottom: 1px solid var(--line);
  background: #030302;
  padding: 12px 24px;
  text-align: center;
}

header h2 {
  font-size: 31px;
  line-height: 1.15;
}

header p {
  margin: 5px 0 0;
  color: #9a8766;
}

.content {
  min-width: 0;
  padding: 24px;
  overflow: auto;
}

.grid {
  display: grid;
  gap: 16px;
}

.two { grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

.card.gold-border { border-color: var(--line); }

.stat {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 6px;
}

.stat span, .subtle {
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  color: white;
  font-size: 26px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tab {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: #080704;
  color: var(--text);
  padding: 9px 13px;
}

.tab.active {
  background: var(--gold);
  color: white;
  border-color: var(--gold);
}

.list {
  display: grid;
  gap: 8px;
  max-height: 62vh;
  overflow: auto;
}

.list-item {
  border: 1px solid var(--line-soft);
  background: #0a0a08;
  border-radius: 8px;
  padding: 11px;
  text-align: left;
}

.list-item.active {
  border-color: var(--gold);
  background: #1a1305;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 11px;
}

.field span {
  color: var(--gold-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

input, textarea, select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080908;
  color: white;
  padding: 9px 10px;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.recipes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.recipe {
  display: grid;
  gap: 10px;
}

.recipe h3 { font-size: 18px; letter-spacing: 1px; }
.materials { color: var(--muted); font-size: 13px; line-height: 1.5; }

.map-wrap {
  position: relative;
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #111;
}

.map-wrap img {
  display: block;
  width: 100%;
  min-height: 620px;
  object-fit: cover;
}

.pin {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 14px currentColor;
}

.map-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(216,173,50,.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216,173,50,.2) 1px, transparent 1px);
  background-size: 32px 32px;
}

.hack-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.game-area {
  min-height: 420px;
  display: grid;
  place-items: center;
  text-align: center;
}

.number-row, .mine-grid, .dots-board, .shifter-grid {
  user-select: none;
}

.attempts {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.mine-grid {
  display: grid;
  gap: 4px;
}

.mine-cell, .shift-cell {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #101010;
  color: white;
  font-weight: 700;
}

.mine-cell.reveal { background: #2b2110; }
.mine-cell.safe { background: #16331f; }
.mine-cell.bad { background: #4b1222; }

.dots-board {
  position: relative;
  width: min(100%, 720px);
  height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050607;
}

.dot {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid white;
  background: var(--gold);
  color: black;
  display: grid;
  place-items: center;
  font-weight: 900;
  transform: translate(-50%, -50%);
}

.dot.done { background: var(--green); color: white; }

.skill-ring {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 14px solid #18202a;
  position: relative;
  display: grid;
  place-items: center;
}

.needle {
  position: absolute;
  width: 4px;
  height: 118px;
  background: var(--red);
  top: 12px;
  left: calc(50% - 2px);
  transform-origin: 2px 118px;
}

.zone {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 14px solid transparent;
  border-top-color: var(--green);
  transform: rotate(210deg);
}

.pinlock {
  width: min(100%, 720px);
  display: grid;
  gap: 18px;
}

.pin-stack {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  align-items: end;
  height: 220px;
}

.lock-pin {
  height: var(--h);
  border-radius: 999px 999px 8px 8px;
  background: var(--gold);
  border: 1px solid white;
  align-self: end;
}

.shift-cell.active {
  background: var(--gold);
  color: black;
}

.empty {
  color: var(--muted);
  border: 1px dashed var(--line-soft);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
}

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .brand-card { height: 180px; }
  .two, .three { grid-template-columns: 1fr; }
  main { grid-template-rows: auto 1fr; }
  header h2 { font-size: 23px; }
}
