:root {
  --main-color: #64748b;
  --main-glow: rgba(100,116,139,.24);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: white;
  background:
    radial-gradient(circle at top left, var(--main-glow), transparent 30%),
    radial-gradient(circle at top right, var(--main-glow), transparent 32%),
    linear-gradient(180deg,#0a0e1c,#05070b);
}

.container {
  width: min(1220px, calc(100% - 32px));
  margin: auto;
  padding: 28px 0 80px;
}

/* Header / tabs — matches the earlier GUI structure */

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 34px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 210px;
}

.brand-icon {
  width: 46px;
  height: 46px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 24px;
}

.brand h1 {
  font-size: 20px;
}

.brand p {
  font-size: 12px;
  color: #94a3b8;
}

.tab-area {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 985px;
}

.tabs,
.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  overflow-x: visible;
  padding: 8px;
  border-radius: 20px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
}

.subtabs {
  background: rgba(255,255,255,.035);
  border-radius: 18px;
}

.tab,
.subtab {
  white-space: nowrap;
  border: 0;
  padding: 12px 11.9px;
  border-radius: 15px;
  background: transparent;
  color: #cbd5e1;
  font-weight: 900;
  font-size: 15px;
  line-height: 1;
  font-family: Arial, Helvetica, sans-serif;
  cursor: pointer;
  text-decoration: none;
  appearance: none;
  -webkit-appearance: none;
}

.subtab {
  padding: 10px 14px;
  color: #94a3b8;
  font-size: 13px;
}

.tab.active {
  background: var(--main-color);
  color: #111827;
}

.subtab.active {
  background: rgba(255, 255, 255, 0.10);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

/* Main layout */

.layout {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 30px;
  align-items: start;
}

.panel {
  background: rgba(15,23,42,.78);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 30px;
  padding: 30px;
  box-shadow: 0 30px 90px rgba(0,0,0,.35);
}

.info {
  position: sticky;
  top: 24px;
}

.pill {
  display: inline-flex;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  margin-bottom: 18px;
  color: #e2e8f0;
}

.game-title {
  font-size: clamp(40px,5vw,64px);
  line-height: .95;
  font-weight: 900;
  letter-spacing: -2px;
  margin-bottom: 22px;
}

.desc {
  color: #cbd5e1;
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 18px;
}

.note {
  margin-top: 16px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
}

.note strong {
  display: block;
  color: var(--main-color);
  margin-bottom: 8px;
}

.note p {
  color: #94a3b8;
  line-height: 1.6;
  font-size: 14px;
}

/* Calculator */

.sim-head {
  margin-bottom: 24px;
}

.sim-head h2 {
  font-size: 28px;
  margin-bottom: 6px;
}

.sim-head p {
  color: #94a3b8;
  line-height: 1.5;
}

.selector-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.selector-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
}

.selector-card label {
  display: block;
  color: #94a3b8;
  font-size: 13px;
  margin-bottom: 8px;
}

.selector-card select {
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  background: #020617;
  color: white;
  border: 1px solid rgba(255,255,255,.14);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.input-card {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
}

.input-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: #cbd5e1;
  font-size: 14px;
}

.input-top strong {
  color: var(--main-color);
}

input[type=range] {
  width: 100%;
  accent-color: var(--main-color);
}

.results {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 14px;
  margin-top: 24px;
}

.result {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
}

.result span {
  display: block;
  color: #94a3b8;
  font-size: 13px;
  margin-bottom: 7px;
}

.formula-note {
  margin-top: 22px;
  padding: 18px;

  border-radius: 22px;

  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);

  color: #f8fafc;
  line-height: 1.6;
  font-size: 14px;

  display: block;
}

.site-shell::before,
.site-shell::after {
  content: "";
  position: fixed;
  left: 0;
  width: 100%;
  height: 3px;

  background: linear-gradient(
    to right,
    transparent,
    rgba(255,255,255,.45),
    transparent
  );

  box-shadow: 0 0 12px rgba(255,255,255,.18);

  z-index: 20;
}

.site-shell::before {
  top: 0;
}

.site-shell::after {
  bottom: 0;
}

.site-shell {
  position: relative;
}

.ad-panel {
  position: fixed;
  top: 28px;
  width: clamp(150px, 15vw, 300px);
  min-height: 870px;
  background: #151515;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 5;
}

.ad-left {
  left: clamp(8px, 1vw, 18px);
}

.ad-right {
  right: clamp(8px, 1vw, 18px);
}

.mobile-ad {
  display: none !important;
}

/* Tablet + phone: hide side ads, show top/bottom ads */
@media (max-width: 1000px) {
  .ad-panel {
    display: none;
  }

  .mobile-ad {
    display: flex;
    width: 100%;
    min-height: 120px;
    margin: 20px 0;
    padding: 12px;
    border-radius: 20px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.1);
    align-items: center;
    justify-content: center;
    color: #777;
    text-align: center;
  }

  .container {
    width: min(100%, calc(100% - 24px));
  }
}



/* Battle Test / Simulation Arena */

.battle-custom-group {
  margin-bottom: 20px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
}

.battle-custom-group.hidden {
  display: none;
}

.battle-custom-head {
  margin-bottom: 14px;
}

.battle-custom-head strong {
  display: block;
  color: var(--main-color);
  margin-bottom: 6px;
}

.battle-custom-head p {
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.5;
}

.enemy-slot-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.enemy-slot {
  display: grid;
  gap: 6px;
}

.enemy-slot label {
  color: #94a3b8;
  font-size: 12px;
}

.enemy-slot select {
  width: 100%;
  padding: 9px;
  border-radius: 10px;
  background: #020617;
  color: white;
  border: 1px solid rgba(255,255,255,.14);
}

.battle-summary {
  margin-top: 22px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
  color: #cbd5e1;
  line-height: 1.6;
  font-size: 14px;
}

.battle-summary strong {
  color: var(--main-color);
}

@media(max-width:900px) {
  .enemy-slot-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media(max-width:650px) {
  .enemy-slot-grid {
    grid-template-columns: 1fr;
  }
}

/* Comparison Mode */

.compare-controls {
  margin-bottom: 20px;
}

.compare-btn {
  padding: 12px 18px;
  border: 0;
  border-radius: 14px;
  background: var(--main-color);
  color: #111827;
  font-weight: 900;
  cursor: pointer;
}

.compare-btn:hover {
  filter: brightness(1.08);
}

.compare-wrapper {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.1);
}

.compare-title {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 16px;
  color: #f8fafc;
}

.compare-results {
  margin-top: 28px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
}

.compare-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  padding: 16px;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid rgba(255,255,255,.06);
  gap: 12px;
}

.compare-row:last-child {
  border-bottom: 0;
}

.compare-header {
  background: rgba(255,255,255,.08);
  font-weight: 900;
  color: #f8fafc;
}

.better {
  color: #22c55e;
  font-weight: 900;
}

.worse {
  color: #f87171;
}

.hidden {
  display: none !important;
}


/* Battle Loader + Phone Notice */

.battle-run-controls {
  margin: 0 0 20px;
}

.battle-run-btn {
  padding: 12px 18px;
  border: 0;
  border-radius: 14px;
  background: var(--main-color);
  color: #111827;
  font-weight: 900;
  cursor: pointer;
}

.battle-run-btn:hover {
  filter: brightness(1.08);
}

.battle-loader,
.rotate-notice {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  display: grid;
  place-items: center;
  z-index: 9999;
  padding: 18px;
}

.battle-loader-box,
.rotate-box {
  width: min(460px, 100%);
  padding: 28px;
  border-radius: 24px;
  background: rgba(15,23,42,.96);
  border: 1px solid rgba(255,255,255,.14);
  text-align: center;
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
}

.battle-loader-box h2,
.rotate-box h2 {
  margin-bottom: 10px;
}

.battle-loader-box p,
.rotate-box p {
  color: #94a3b8;
  line-height: 1.5;
}

.progress-shell {
  width: 100%;
  height: 14px;
  margin-top: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: var(--main-color);
  transition: width .2s linear;
}

.rotate-box button {
  margin-top: 18px;
  padding: 10px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--main-color);
  color: #111827;
  font-weight: 900;
  cursor: pointer;
}

/* Responsive */
@media(max-width:1000px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .info {
    position: static;
  }

  .results,
  .selector-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media(max-width:650px) {
  .grid,
  .results,
  .selector-grid {
    grid-template-columns: 1fr;
  }

  .brand {
    min-width: auto;
  }
}

.logo-container {
    text-align: center;
    margin-top: 20px;
}

.main-logo {
    width: 120px;
    max-width: 90%;
    height: auto;
}


/* Battle Run Button + Pie Chart */

.battle-run-panel {
  width: 100%;
  margin-top: 40px;
  margin-bottom: 40px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.battle-run-btn {
  padding: 14px 22px;
  border: 0;
  border-radius: 16px;
  background: var(--main-color);
  color: #111827;
  font-weight: 900;
  cursor: pointer;
  font-size: 14px;
  transition: .2s;
}

.battle-run-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.battle-chart-panel {
  margin-top: 22px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
}

.battle-chart-panel.hidden {
  display: none;
}

.battle-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.battle-chart-head strong {
  color: var(--main-color);
  display: block;
  margin-bottom: 4px;
}

.battle-chart-head p {
  color: #94a3b8;
  line-height: 1.5;
  font-size: 13px;
}

.battle-chart-wrap {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 22px;
  align-items: center;
}

#battlePieChart {
  width: 260px;
  height: 260px;
  max-width: 100%;
}

.battle-chart-legend {
  display: grid;
  gap: 10px;
}

.legend-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  color: #cbd5e1;
  font-size: 14px;
}

.legend-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

@media(max-width: 760px) {
  .battle-chart-wrap {
    grid-template-columns: 1fr;
  }

  #battlePieChart {
    margin: auto;
  }

  .battle-run-panel {
  width: 100%;
  margin-top: 24px;
  margin-bottom: 24px;
  padding: 24px 28px;
  border-radius: 24px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

  .battle-run-btn {
    width: 100%;
  }
}




/* Exact Stat Entry */

.input-control-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: center;
}

.stat-spinner {
  width: 88px;
  padding: 7px 6px;
  border-radius: 12px;
  background: #020617;
  color: var(--main-color);
  border: 1px solid rgba(255,255,255,.14);
  font-weight: 900;
  text-align: center;
  accent-color: var(--main-color);
}

.stat-spinner:focus {
  outline: 1px solid var(--main-color);
  border-color: var(--main-color);
}

.stat-spinner::-webkit-inner-spin-button,
.stat-spinner::-webkit-outer-spin-button {
  opacity: 1;
  cursor: pointer;
}

.input-top {
  align-items: center;
}

.input-value-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-suffix {
  color: var(--main-color);
  font-weight: 900;
  font-size: 13px;
}

.input-top strong {
  display: none;
}

@media(max-width:650px) {
  .input-control-row {
    grid-template-columns: 1fr;
  }
}



.seo-text {
  margin-top: 24px;
  padding-top: 12px;
  color: #94a3b8;
  line-height: 1.7;
  font-size: 14px;
}

.seo-text {
  margin-top: 40px;
}


/* Publisher-content sections for AdSense review */
.content-guide {
  margin-top: 34px;
  display: grid;
  gap: 22px;
}

.content-card {
  background: rgba(15,23,42,.78);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
}

.content-card h2 {
  font-size: 26px;
  margin-bottom: 12px;
  color: #f8fafc;
}

.content-card h3 {
  font-size: 18px;
  margin: 18px 0 8px;
  color: var(--main-color);
}

.content-card p,
.content-card li {
  color: #cbd5e1;
  line-height: 1.75;
  font-size: 15px;
}

.content-card ul {
  padding-left: 22px;
  margin-top: 10px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.guide-note {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.1);
}

.faq details {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 14px 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 900;
  color: #f8fafc;
}

.site-footer {
  margin-top: 34px;
  padding: 22px;
  border-radius: 24px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  color: #94a3b8;
}

.site-footer a {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 700;
}

.site-footer a:hover {
  color: white;
}

@media(max-width:800px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
}

.brand {
  position: relative;
}

.scroll-note {
  position: absolute;
  left: 0;
  top: 125px;

  width: 320px;

  font-size: 18px !important;

  color: #cbd5e1 !important;
  font-weight: 700;
  line-height: 1.25;
}

/* Phone orientation notice */

.rotate-notice {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  display: grid;
  place-items: center;
  z-index: 9999;
  padding: 18px;
}

.rotate-box {
  width: min(460px, 100%);
  padding: 28px;
  border-radius: 24px;
  background: rgba(15,23,42,.96);
  border: 1px solid rgba(255,255,255,.14);
  text-align: center;
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
}

.rotate-box h2 {
  margin-bottom: 10px;
}

.rotate-box p {
  color: #94a3b8;
  line-height: 1.5;
}

.rotate-box button {
  margin-top: 18px;
  padding: 10px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--main-color);
  color: #111827;
  font-weight: 900;
  cursor: pointer;
}
