/* Widgetworks — game-specific styles (layered on top of the site stylesheet) */

.game-body { background: var(--bg); }

.game-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 6.5rem 1.2rem 4rem;
}

.game-head { text-align: center; margin-bottom: 2rem; }
.game-head h1 {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.game-head h1 span { color: var(--purple-soft); }
.game-tag { color: var(--text-dim); font-style: italic; margin-top: 0.3rem; }

/* scoreboard */

.scoreboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.6rem;
  position: sticky;
  top: 62px;
  z-index: 20;
}
.stat {
  background: rgba(27, 17, 41, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  text-align: center;
  transition: border-color 0.3s var(--ease);
}
.stat-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-dim);
}
.stat-value { font-weight: 700; font-size: 1.05rem; color: var(--purple-pale); }
.stat-value.neg { color: #f9a8d4; }
.stat.flash { border-color: var(--purple); animation: statflash 0.7s var(--ease); }
@keyframes statflash {
  0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.55); }
  100% { box-shadow: 0 0 0 14px rgba(139, 92, 246, 0); }
}

/* layout */

.game-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
  align-items: start;
}
@media (max-width: 860px) { .game-grid { grid-template-columns: 1fr; } }
.game-col { display: flex; flex-direction: column; gap: 1.4rem; }

.panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
}
.panel h2 {
  font-size: 1.05rem;
  color: var(--purple-pale);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}
.panel-hint { font-size: 0.84rem; color: var(--text-dim); margin-bottom: 0.9rem; }
.empty-note { color: var(--text-dim); font-size: 0.88rem; font-style: italic; }

/* buttons & inputs */

.btn {
  background: var(--purple-deep);
  color: #fff;
  border: 1px solid var(--purple);
  border-radius: 9px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s var(--ease), transform 0.15s var(--ease), box-shadow 0.25s var(--ease);
}
.btn:hover { background: var(--purple); box-shadow: 0 6px 18px -6px rgba(139, 92, 246, 0.6); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: transparent; color: var(--purple-pale); }
.btn-ghost:hover { background: rgba(139, 92, 246, 0.15); }
.btn-big { width: 100%; padding: 0.9rem; font-size: 1.05rem; }
.btn-small { padding: 0.3rem 0.7rem; font-size: 0.78rem; }

input[type="number"], select {
  background: var(--bg-raised);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
  font-family: inherit;
}
input[type="number"]:focus, select:focus {
  outline: none;
  border-color: var(--purple);
}

.bank-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.bank-row input { flex: 1; min-width: 110px; }
.bank-msg { font-size: 0.84rem; margin-top: 0.6rem; min-height: 1.2em; color: var(--purple-soft); }
.bank-msg.err { color: #f9a8d4; }

/* market cards */

.market-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.7rem;
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  transition: border-color 0.3s var(--ease);
}
.market-item.is-new { border-color: var(--purple); background: rgba(139, 92, 246, 0.08); }
.market-name { font-weight: 700; color: var(--purple-pale); }
.market-new-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  background: var(--purple-deep);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  margin-left: 0.45rem;
  vertical-align: middle;
}
.market-detail { font-size: 0.82rem; color: var(--text-dim); }
.market-nums { text-align: right; font-size: 0.85rem; }
.market-nums strong { color: var(--text); }

/* machine shop */

.shop-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.7rem;
}
.shop-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
.shop-name { font-weight: 700; color: var(--text); }
.shop-price { color: var(--purple-pale); font-weight: 700; }
.shop-desc { font-size: 0.8rem; color: var(--text-dim); margin: 0.25rem 0 0.6rem; }
.shop-buy { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }

/* factory */

.cap-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-bottom: 1rem; }
.cap-table th, .cap-table td { padding: 0.35rem 0.5rem; text-align: right; border-bottom: 1px solid var(--line); }
.cap-table th:first-child, .cap-table td:first-child { text-align: left; }
.cap-table th { color: var(--text-dim); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }
.cap-short { color: #f9a8d4; }
.cap-ok { color: #a7f3d0; }

.machine-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.55rem;
  animation: rowin 0.45s var(--ease);
}
@keyframes rowin {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.machine-info { font-size: 0.86rem; }
.machine-name { font-weight: 700; }
.machine-meta { color: var(--text-dim); font-size: 0.78rem; }
.machine-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* reports */

.report {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 0.9rem;
  animation: rowin 0.5s var(--ease);
}
.report h3 { font-size: 0.95rem; color: var(--purple-pale); margin-bottom: 0.5rem; }
.table-scroll { overflow-x: auto; }
.report-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.report-table td:nth-child(7), .cap-table td:nth-child(5) { white-space: nowrap; }
.report-table th, .report-table td { padding: 0.3rem 0.4rem; text-align: right; border-bottom: 1px solid var(--line); }
.report-table th:first-child, .report-table td:first-child { text-align: left; }
.report-table th { color: var(--text-dim); font-weight: 600; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; }
.report-fin { font-size: 0.84rem; margin-top: 0.6rem; color: var(--text-dim); }
.report-fin strong { color: var(--text); }
.report-stars { margin-top: 0.4rem; font-size: 0.9rem; color: #fbbf24; }
.report-news {
  margin-top: 0.6rem;
  padding: 0.55rem 0.8rem;
  border: 1px dashed var(--purple);
  border-radius: 8px;
  font-size: 0.84rem;
  color: var(--purple-pale);
}

/* rules */

.rules-panel { margin-top: 1.4rem; }
.rules-list { padding-left: 1.2rem; font-size: 0.9rem; color: var(--text-dim); }
.rules-list li { margin-bottom: 0.35rem; }
.rules-list strong, .rules-list em { color: var(--text); }

/* end overlay */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 5, 20, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
  animation: fadein 0.5s var(--ease);
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.overlay[hidden] { display: none; }
.overlay-card {
  background: var(--bg-card);
  border: 1px solid var(--purple);
  border-radius: var(--radius);
  max-width: 480px;
  width: 100%;
  padding: 2.2rem;
  text-align: center;
  box-shadow: 0 30px 80px -20px rgba(109, 40, 217, 0.6);
  animation: rowin 0.6s var(--ease);
}
.overlay-card h2 { font-size: 1.7rem; margin-bottom: 1rem; color: var(--purple-pale); }
.overlay-card #end-body { color: var(--text-dim); font-size: 0.95rem; margin-bottom: 1.6rem; }
.overlay-card #end-body strong { color: var(--text); }
.end-line { margin-bottom: 0.4rem; }
