/* Idle Loops D7 Edition: the beagle.games "control room" theme, shared with Reactor Idle D7 Edition
   (same tokens and pieces as games/reactoridle/css/theme.css). Design tokens, app chrome, panels,
   buttons, chips, tooltips and dialogs. The play screen is in game.css. */

:root {
  /* Surfaces */
  --bg: #0a0e13;
  --bg-raised: #10161e;
  --panel: #141b24;
  --panel-hi: #1a2330;
  --inset: #0c1117;
  --line: #243040;
  --line-hi: #34465a;

  /* Text */
  --text: #e8eef4;
  --muted: #93a3b4;
  --dim: #5e6d7d;

  /* Resources */
  --mana: #8c96ff;
  --gold: #ffc44d;
  --rep: #ff7ac6;
  --bonus: #4fd5ff;

  /* Stats */
  --stat-Dex: #ffc44d;
  --stat-Str: #ff6a4d;
  --stat-Con: #d6f05a;
  --stat-Spd: #4fd5ff;
  --stat-Per: #63a9ff;
  --stat-Cha: #ff7ac6;
  --stat-Int: #b894ff;
  --stat-Luck: #2ee6a6;
  --stat-Soul: #e8eef4;

  /* Interaction */
  --accent: #2ee6a6;
  --accent-dim: #1d8f69;
  --danger: #ff5a5f;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "SF Mono", Consolas, "Roboto Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  overflow-y: scroll;
  min-height: 100%;
  color: var(--text);
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font: 13px/1.45 var(--font);
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(140, 150, 255, 0.11), transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(46, 230, 166, 0.06), transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}

a:hover {
  color: #7af5c9;
}

b,
strong {
  font-weight: 600;
}

button {
  font: inherit;
}

.mana {
  color: var(--mana);
}
.gold {
  color: var(--gold);
}
.rep {
  color: var(--rep);
}
.dim {
  color: var(--dim);
}
.muted {
  color: var(--muted);
}
.num {
  font-family: var(--mono);
}

/* ---- App chrome ---------------------------------------------------------------------------- */

#app {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px 24px;
}

.appHeader {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
  padding: 0 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.brand,
.brand:hover {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  user-select: none;
}

.brandMark {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 0 8px rgba(140, 150, 255, 0.6));
}

.brandMark .spin {
  transform-origin: 16px 16px;
  animation: brandSpin 12s linear infinite;
}

@keyframes brandSpin {
  to {
    transform: rotate(360deg);
  }
}

.brandText {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brandName {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brandTag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
}

.appNav {
  flex: 1;
}

.appTools {
  display: flex;
  gap: 6px;
}

.toolButton {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--bg-raised);
  font-weight: 600;
  cursor: pointer;
}

.toolButton:hover {
  color: var(--text);
  border-color: var(--line-hi);
}

.toolButton svg {
  width: 16px;
  height: 16px;
}

.toolButton .newDot {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.appFooter {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--dim);
  font-size: 12px;
}

.appFooter a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--line-hi);
}

/* ---- Panels -------------------------------------------------------------------------------- */

.panel {
  position: relative;
  background: linear-gradient(180deg, var(--panel-hi), var(--panel) 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px 14px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03) inset,
    0 6px 18px rgba(0, 0, 0, 0.25);
}

.panelTitle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.panelTitle::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--led, var(--accent));
  box-shadow: 0 0 8px var(--led, var(--accent));
}

.panelTitle .spacer {
  flex: 1;
}

.subTitle {
  margin: 14px 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---- Buttons ------------------------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #23c58f, #179a6e);
  color: #04140e;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  user-select: none;
  transition:
    filter 0.12s,
    transform 0.06s;
}

.button:hover {
  filter: brightness(1.12);
  color: #04140e;
}

.button:active {
  transform: translateY(1px);
}

.button svg {
  width: 14px;
  height: 14px;
}

.button.ghost {
  background: transparent;
  border-color: var(--line-hi);
  color: var(--muted);
}

.button.ghost:hover {
  color: var(--text);
  border-color: var(--muted);
  filter: none;
}

.button.small {
  padding: 4px 10px;
  font-size: 12px;
}

.button.danger {
  background: transparent;
  border-color: rgba(255, 90, 95, 0.5);
  color: var(--danger);
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line-hi);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.segmented button {
  min-width: 34px;
  padding: 4px 10px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button:hover {
  color: var(--text);
}

.segmented button.on {
  background: rgba(46, 230, 166, 0.14);
  color: var(--accent);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--inset);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.chip .label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chip .value {
  font-family: var(--mono);
  font-weight: 600;
}

.check {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.check input {
  accent-color: var(--accent);
  margin: 0;
}

.check:hover {
  color: var(--text);
}

/* ---- Bars ---------------------------------------------------------------------------------- */

.bar {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: var(--inset);
  overflow: hidden;
}

.bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: var(--bar, var(--accent));
}

/* ---- Tooltip ------------------------------------------------------------------------------- */

#tooltip {
  position: fixed;
  z-index: 60;
  max-width: 340px;
  padding: 10px 12px;
  border: 1px solid var(--line-hi);
  border-radius: 8px;
  background: rgba(16, 22, 30, 0.97);
  box-shadow: var(--shadow);
  color: var(--text);
  pointer-events: none;
  display: none;
}

#tooltip h4 {
  margin: 0 0 4px;
  font-size: 13px;
}

#tooltip p {
  margin: 4px 0;
  color: var(--muted);
}

#tooltip ul {
  margin: 6px 0;
  padding-left: 16px;
  color: var(--muted);
}

#tooltip li {
  margin: 2px 0;
}

#tooltip .rows {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  margin-top: 6px;
}

#tooltip .rows span:nth-child(odd) {
  color: var(--dim);
}

#tooltip .rows span:nth-child(even) {
  font-family: var(--mono);
  text-align: right;
}

/* ---- Dialogs ------------------------------------------------------------------------------- */

.modalBg {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(4, 8, 12, 0.72);
  backdrop-filter: blur(3px);
}

.modal {
  position: fixed;
  z-index: 51;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(640px, calc(100vw - 32px));
  max-height: 86vh;
  overflow-y: auto;
  padding: 0 22px 20px;
  border: 1px solid var(--line-hi);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--panel-hi), var(--panel) 70px);
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(0, 0, 0, 0.4);
}

.modalHeader {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -22px 12px;
  padding: 16px 22px 12px;
  background: var(--panel-hi);
  border-bottom: 1px solid var(--line);
}

.modalHeader h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.modalClose {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.modalClose:hover {
  background: var(--inset);
  color: var(--text);
}

.modalClose svg {
  width: 16px;
  height: 16px;
}

.modalSection {
  margin: 18px 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.modal p,
.modal li {
  color: var(--muted);
}

.modal p {
  margin: 6px 0;
}

.modal ul {
  margin: 6px 0;
  padding-left: 18px;
}

.modal textarea {
  width: 100%;
  min-height: 74px;
  padding: 8px 10px;
  border: 1px solid var(--line-hi);
  border-radius: var(--radius-sm);
  background: var(--inset);
  color: var(--text);
  font: 12px/1.4 var(--mono);
  resize: vertical;
}

.modal .row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.modal .note {
  color: var(--dim);
  font-size: 12px;
}
