@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600&family=Syne:wght@400;700&display=swap");

:root {
  --ink: #171614;
  --paper: #f7f1e3;
  --sand: #f1e2c7;
  --sun: #f3b34c;
  --sea: #1f9b98;
  --leaf: #7bb35f;
  --berry: #e56b6f;
  --stroke: rgba(23, 22, 20, 0.18);
  --shadow: rgba(23, 22, 20, 0.14);
  --glow: rgba(243, 179, 76, 0.4);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background-image:
    radial-gradient(900px 600px at 82% -10%, rgba(243, 179, 76, 0.42), transparent 60%),
    radial-gradient(700px 450px at 12% 12%, rgba(31, 155, 152, 0.25), transparent 60%),
    linear-gradient(180deg, #f7f1e3 0%, #f3e4cd 45%, #f1d9c1 100%);
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.35), transparent 60%);
  mix-blend-mode: screen;
  opacity: 0.6;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 32px;
  padding: 48px 8vw 24px;
}

.hero-text h1 {
  font-family: "Syne", "Space Grotesk", sans-serif;
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  margin: 12px 0 8px;
  letter-spacing: -0.02em;
}

.hero-text {
  max-width: 640px;
  animation: fadeUp 0.7s ease;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: rgba(23, 22, 20, 0.6);
  margin: 0;
}

.lead {
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0 0 20px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-card {
  background: rgba(247, 241, 227, 0.7);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 40px var(--shadow);
  backdrop-filter: blur(6px);
  animation: floatIn 0.8s ease;
}

.hero-card h2 {
  margin-top: 0;
  font-family: "Syne", "Space Grotesk", sans-serif;
}

.status-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(23, 22, 20, 0.15);
  font-size: 0.95rem;
}

.status-row:last-child {
  border-bottom: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
  padding: 0 8vw 60px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 8vw 24px;
}

.tab-button {
  border: 1px solid rgba(23, 22, 20, 0.2);
  background: rgba(247, 241, 227, 0.6);
  color: var(--ink);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.tab-button:hover {
  transform: translateY(-1px);
}

.tab-button.active {
  background: var(--sea);
  color: white;
  border-color: transparent;
  box-shadow: 0 10px 18px rgba(31, 155, 152, 0.25);
}

.tabs-root {
  padding-bottom: 60px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.panel {
  grid-column: span 4;
  background: rgba(247, 241, 227, 0.82);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 18px 36px rgba(23, 22, 20, 0.08);
}

.panel.wide {
  grid-column: span 8;
}

.panel.full {
  grid-column: span 12;
}

.panel.highlight {
  border: 2px solid rgba(243, 179, 76, 0.6);
  background: rgba(243, 179, 76, 0.08);
  box-shadow: 0 20px 38px rgba(243, 179, 76, 0.18);
}

.panel.muted {
  background: rgba(247, 241, 227, 0.6);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hidden-input {
  display: none;
}

.panel h2 {
  margin: 0;
  font-family: "Syne", "Space Grotesk", sans-serif;
  font-size: 1.5rem;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

input[type="number"],
input[type="search"],
input[type="text"] {
  border: 1px solid rgba(23, 22, 20, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.7);
}

select {
  border: 1px solid rgba(23, 22, 20, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.7);
}

input[type="number"]:focus,
input[type="search"]:focus,
input[type="text"]:focus {
  outline: 2px solid rgba(31, 155, 152, 0.4);
  border-color: transparent;
}

select:focus {
  outline: 2px solid rgba(31, 155, 152, 0.4);
  border-color: transparent;
}

.control-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 16px;
}

.button {
  border: none;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--sea);
  color: white;
  box-shadow: 0 10px 20px rgba(31, 155, 152, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(31, 155, 152, 0.3);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.button.primary {
  background: linear-gradient(120deg, #1f9b98, #2fb5a4);
}

.button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(23, 22, 20, 0.2);
  box-shadow: none;
}

.button.small {
  padding: 8px 14px;
  font-size: 0.8rem;
}

.chip {
  background: rgba(31, 155, 152, 0.12);
  color: #166f6d;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.chip.focus {
  background: rgba(243, 179, 76, 0.3);
  color: #6a3e00;
}

.chip.muted {
  background: rgba(23, 22, 20, 0.12);
  color: rgba(23, 22, 20, 0.7);
}

.chip.small {
  font-size: 0.7rem;
  padding: 4px 10px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pokemon-list {
  max-height: 280px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(23, 22, 20, 0.12);
  background: rgba(255, 255, 255, 0.65);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.poke-option {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 10px;
  transition: background 0.2s ease;
}

.poke-option:hover {
  background: rgba(31, 155, 152, 0.12);
}

.poke-option span {
  text-transform: capitalize;
}

.notice {
  margin-top: 12px;
  color: var(--berry);
  font-size: 0.9rem;
  min-height: 1.2em;
}

.hint {
  color: rgba(23, 22, 20, 0.6);
  font-size: 0.85rem;
  margin-top: 10px;
}

.players-root {
  display: grid;
  gap: 16px;
}

.player-card {
  background: rgba(255, 255, 255, 0.75);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(23, 22, 20, 0.1);
  box-shadow: inset 0 0 0 1px rgba(23, 22, 20, 0.05);
}

.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.player-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

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

.pokemon-card {
  position: relative;
  border-radius: 14px;
  border: 1px solid rgba(23, 22, 20, 0.1);
  padding: 10px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 18px rgba(23, 22, 20, 0.08);
  animation: fadeUp 0.5s ease both;
}

.slot-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(243, 179, 76, 0.9);
  color: #3a2f14;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}

.pokemon-card img {
  width: 100%;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(23, 22, 20, 0.15));
}

.pokemon-card h4 {
  margin: 6px 0 4px;
  text-transform: capitalize;
  font-size: 1rem;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: rgba(23, 22, 20, 0.7);
}

.hp-label {
  font-weight: 600;
}

.hp-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(23, 22, 20, 0.12);
  overflow: hidden;
  margin: 6px 0 10px;
}

.hp-bar span {
  display: block;
  height: 100%;
  background: #6cbf6b;
  transition: width 0.3s ease;
}

.hp-bar.mid span {
  background: #f3b34c;
}

.hp-bar.low span {
  background: #e56b6f;
}

.type-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.type-badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  color: white;
}

.type-normal { background: #9099a1; }
.type-fire { background: #f98b4d; }
.type-water { background: #5aa7d9; }
.type-electric { background: #f2c14e; color: #3a2f14; }
.type-grass { background: #6cbf6b; }
.type-ice { background: #7bc5d8; color: #1f2d33; }
.type-fighting { background: #d36b5f; }
.type-poison { background: #a26bb7; }
.type-ground { background: #c5a36c; color: #3c2b12; }
.type-flying { background: #8aa7e8; }
.type-psychic { background: #f1719a; }
.type-bug { background: #8fbf4f; color: #2a3a1d; }
.type-rock { background: #b9a06b; color: #3e2f18; }
.type-ghost { background: #6f6aa8; }
.type-dragon { background: #8b6fd3; }

.stats {
  display: grid;
  gap: 4px;
  font-size: 0.75rem;
  color: rgba(23, 22, 20, 0.75);
}

.stats span {
  display: flex;
  justify-content: space-between;
}

.move-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin: 8px 0;
}

.move-btn {
  border: 1px solid rgba(23, 22, 20, 0.15);
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 0.7rem;
  background: rgba(243, 179, 76, 0.15);
  color: #3a2f14;
  text-align: center;
  cursor: default;
}

.move-btn.empty {
  background: rgba(23, 22, 20, 0.05);
  color: rgba(23, 22, 20, 0.4);
}

.move-editor {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.move-selects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.move-select {
  width: 100%;
}

.move-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.lock-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: rgba(23, 22, 20, 0.7);
}

.item-list {
  display: grid;
  gap: 10px;
}

.item-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.item-row input[type="text"] {
  width: 100%;
}

.item-row input[type="number"] {
  width: 90px;
}

.remove-btn {
  background: transparent;
  border: 1px solid rgba(23, 22, 20, 0.2);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}

.event-block {
  margin-bottom: 18px;
}

.event-block h3 {
  margin: 0 0 8px;
}

.event-list {
  display: grid;
  gap: 10px;
}

.battle-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.battle-side {
  display: grid;
  gap: 12px;
}

.battle-active {
  font-size: 0.85rem;
  color: rgba(23, 22, 20, 0.75);
}

.battle-roster {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.battle-row {
  display: grid;
  grid-template-columns: 20px 1fr 1fr;
  gap: 10px;
  align-items: center;
  border-radius: 12px;
  padding: 8px;
  border: 1px solid rgba(23, 22, 20, 0.12);
  background: rgba(255, 255, 255, 0.75);
}

.battle-row.active {
  border-color: rgba(31, 155, 152, 0.5);
  box-shadow: inset 0 0 0 1px rgba(31, 155, 152, 0.2);
}

.battle-row.fainted {
  opacity: 0.6;
}

.battle-name {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.battle-name img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(23, 22, 20, 0.15));
}

.battle-name .battle-text {
  display: grid;
  gap: 2px;
}

.battle-name span {
  font-size: 0.75rem;
  color: rgba(23, 22, 20, 0.6);
}

.battle-hp {
  display: grid;
  gap: 4px;
  font-size: 0.75rem;
}

.battle-actions {
  grid-column: 2 / span 2;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.battle-item {
  border: 1px solid rgba(23, 22, 20, 0.2);
  background: transparent;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.7rem;
  cursor: pointer;
}

.battle-item:hover {
  background: rgba(31, 155, 152, 0.12);
}

.battle-controls {
  display: grid;
  gap: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  padding: 12px;
  border: 1px solid rgba(23, 22, 20, 0.12);
}

.battle-log-panel {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(23, 22, 20, 0.12);
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 8px;
  max-height: 720px;
}

.battle-log-panel h3 {
  margin: 0;
  font-family: "Syne", "Space Grotesk", sans-serif;
}

.battle-log {
  display: grid;
  gap: 8px;
  overflow: auto;
}

.battle-log-row {
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(247, 241, 227, 0.7);
  border: 1px dashed rgba(23, 22, 20, 0.12);
  font-size: 0.8rem;
}

.battle-time {
  font-size: 0.7rem;
  color: rgba(23, 22, 20, 0.6);
}

.event-card {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(23, 22, 20, 0.12);
  background: rgba(255, 255, 255, 0.75);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.event-card strong {
  font-size: 0.95rem;
}

.empty {
  color: rgba(23, 22, 20, 0.5);
  font-size: 0.85rem;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

  .panel {
    grid-column: span 6;
  }

  .panel.wide {
    grid-column: span 12;
  }

  .battle-shell {
    grid-template-columns: 1fr;
  }

  .battle-log-panel {
    max-height: none;
  }
}

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

  .panel,
  .panel.wide {
    grid-column: span 1;
  }

  .hero {
    padding: 36px 6vw 18px;
  }

  .tabs {
    padding: 0 6vw 18px;
  }

  .battle-row {
    grid-template-columns: 20px 1fr;
  }

  .battle-hp {
    grid-column: 2;
  }

  .battle-actions {
    grid-column: 2;
  }

  .battle-music {
    width: 100%;
    justify-content: space-between;
  }
}
.hidden {
  display: none !important;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.config-grid {
  align-items: end;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(23, 22, 20, 0.12);
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.field.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  margin-bottom: 0;
  border-radius: 12px;
  background: rgba(241, 226, 199, 0.5);
  border: 1px solid rgba(23, 22, 20, 0.08);
}

.team-slots {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.npc-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.npc-card {
  background: rgba(247, 241, 227, 0.85);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 14px 30px rgba(23, 22, 20, 0.08);
}

.npc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.battle-setup {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.battle-selection {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

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

.battle-music {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.battle-music input[type="range"] {
  width: 140px;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(23, 22, 20, 0.6);
  z-index: 50;
}

.modal-card {
  width: min(420px, 100%);
  background: #fdf6e9;
  border-radius: 18px;
  border: 1px solid rgba(23, 22, 20, 0.15);
  box-shadow: 0 20px 50px rgba(23, 22, 20, 0.25);
  padding: 24px;
  display: grid;
  gap: 12px;
  text-align: center;
}

.modal-card h3 {
  margin: 0;
}

.modal-card p {
  margin: 0;
  color: rgba(23, 22, 20, 0.8);
}

.battle-select {
  background: rgba(241, 226, 199, 0.6);
  border-radius: 12px;
  padding: 12px;
  border: 1px dashed rgba(23, 22, 20, 0.2);
}

.battle-check {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 6px 0;
}

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

.log-row {
  display: flex;
  gap: 12px;
  font-size: 0.9rem;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.5);
}

.auction-card {
  margin-top: 12px;
}

.bid-list {
  display: grid;
  gap: 10px;
}

.bid-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(23, 22, 20, 0.12);
  font-size: 0.9rem;
}

.bid-row strong {
  font-variant-numeric: tabular-nums;
}

.auction-target {
  margin: 8px 0 4px;
}

.log-time {
  color: rgba(23, 22, 20, 0.6);
  font-variant-numeric: tabular-nums;
}

.inventory {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.inventory-row {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(241, 226, 199, 0.6);
}

.inventory-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inventory-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.inventory-actions select {
  min-width: 160px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-right: 4px;
  background: rgba(228, 92, 72, 0.15);
  color: #b23327;
}

.inventory-hint {
  font-size: 0.8rem;
  color: rgba(23, 22, 20, 0.65);
}

.player-meta {
  display: flex;
  gap: 12px;
  color: rgba(23, 22, 20, 0.7);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.battle-shell.empty {
  opacity: 0.6;
}

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