@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Inter:wght@300;400;500;600;700&display=swap");

:root {
  --background: #121824;
  --background-2: #0b1220;
  --foreground: #ede4cf;
  --card: rgba(26, 35, 48, 0.92);
  --card-2: rgba(18, 27, 39, 0.96);
  --primary: #e1a93b;
  --primary-soft: rgba(225, 169, 59, 0.16);
  --accent: #2497c8;
  --accent-soft: rgba(36, 151, 200, 0.16);
  --muted: #8590a2;
  --muted-soft: rgba(133, 144, 162, 0.14);
  --danger: #df4f4f;
  --danger-soft: rgba(223, 79, 79, 0.12);
  --success: #4faf69;
  --success-soft: rgba(79, 175, 105, 0.14);
  --border: rgba(110, 128, 149, 0.26);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at 15% 10%, rgba(36, 151, 200, 0.16), transparent 26%),
    radial-gradient(circle at 85% 12%, rgba(225, 169, 59, 0.1), transparent 20%),
    linear-gradient(180deg, #0b1220 0%, #121824 46%, #0a101a 100%);
  color: var(--foreground);
  font-family: "Inter", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.04), transparent 30%),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 74px,
      rgba(255, 255, 255, 0.012) 75px,
      rgba(255, 255, 255, 0.012) 76px
    );
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.95rem 1rem;
}

.shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 60px;
}

.header-bar,
.card,
.message,
.overlay-card,
.combat-shell,
.region-card,
.stat-box,
.choice-button,
.action-card,
.mini-panel,
.list-item,
.log-panel,
.create-card {
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.header-bar,
.card,
.message,
.overlay-card,
.combat-shell,
.region-card,
.stat-box,
.choice-button,
.action-card,
.mini-panel,
.list-item,
.log-panel,
.create-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  position: sticky;
  top: 10px;
  z-index: 10;
  background: linear-gradient(135deg, rgba(18, 27, 39, 0.98), rgba(26, 35, 48, 0.94));
}

.heading-font {
  font-family: "Cinzel", serif;
}

.title,
.section-title,
.create-title {
  font-family: "Cinzel", serif;
  margin: 0;
}

.title {
  font-size: 1.25rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
}

.subtitle,
.muted,
.meta-line,
.subcopy {
  color: var(--muted);
}

.tag-row,
.toolbar,
.button-row,
.combat-actions,
.choice-list,
.flex-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.tag.primary {
  color: var(--primary);
  border-color: rgba(225, 169, 59, 0.28);
  background: var(--primary-soft);
}

.tag.accent {
  color: #66c5ee;
  border-color: rgba(36, 151, 200, 0.28);
  background: var(--accent-soft);
}

.tag.danger {
  color: #ffb8b8;
  border-color: rgba(223, 79, 79, 0.28);
  background: var(--danger-soft);
}

.tag.success {
  color: #9fe0b3;
  border-color: rgba(79, 175, 105, 0.24);
  background: var(--success-soft);
}

.btn {
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.045);
  color: var(--foreground);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.btn:hover:not(:disabled),
.choice-button:hover:not(:disabled),
.action-card:hover:not(:disabled),
.list-item.is-clickable:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #ebb24b, #c88c18);
  color: #1e1607;
  border-color: rgba(225, 169, 59, 0.4);
  font-weight: 700;
}

.btn-accent {
  background: linear-gradient(135deg, #43a8d3, #177ba7);
  color: #07121b;
  border-color: rgba(36, 151, 200, 0.38);
  font-weight: 700;
}

.btn-muted {
  background: rgba(255, 255, 255, 0.035);
}

.btn-danger {
  background: rgba(223, 79, 79, 0.14);
  color: #ffc6c6;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
  gap: 18px;
  margin-top: 18px;
}

.stack {
  display: grid;
  gap: 18px;
}

.card,
.message,
.overlay-card,
.combat-shell {
  padding: 18px;
}

.hud-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.hud-name {
  color: var(--primary);
  font-family: "Cinzel", serif;
  font-size: 1.1rem;
  margin: 0 0 4px;
}

.grid-2,
.grid-3,
.grid-4,
.stats-mini,
.create-grid {
  display: grid;
  gap: 12px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4,
.stats-mini {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-box,
.mini-panel,
.region-card,
.list-item {
  padding: 14px;
}

.stat-box strong,
.mini-panel strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
}

.progress-wrap {
  margin-top: 12px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #56cf79, #86f3a5);
}

.fill.stamina {
  background: linear-gradient(90deg, #35a5d6, #7ed8f7);
}

.fill.xp {
  background: linear-gradient(90deg, #c27dff, #e0a2ff);
}

.story-copy {
  line-height: 1.7;
  color: rgba(237, 228, 207, 0.94);
}

.story-copy strong {
  color: var(--primary);
}

.story-copy em {
  color: #66c5ee;
  font-style: italic;
}

.choice-list {
  flex-direction: column;
  margin-top: 16px;
}

.choice-button {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.035);
}

.choice-index {
  color: rgba(225, 169, 59, 0.62);
  font-family: "Cinzel", serif;
  margin-right: 12px;
}

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

.action-card {
  min-height: 94px;
  padding: 16px;
  text-align: left;
  color: var(--foreground);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.045), rgba(36, 151, 200, 0.08));
}

.action-card strong {
  display: block;
  margin-bottom: 8px;
}

.message {
  margin-top: 18px;
  background: rgba(225, 169, 59, 0.08);
  border-color: rgba(225, 169, 59, 0.18);
}

.info-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(10, 16, 26, 0.9);
  backdrop-filter: blur(10px);
  overflow-y: auto;
  padding: 18px;
}

.overlay-wrap {
  width: min(1040px, 100%);
  margin: 0 auto;
}

.overlay-card {
  background: linear-gradient(180deg, rgba(18, 27, 39, 0.98), rgba(26, 35, 48, 0.94));
}

.region-card {
  background: linear-gradient(135deg, rgba(36, 55, 79, 0.45), rgba(18, 27, 39, 0.58));
}

.region-east {
  background: linear-gradient(135deg, rgba(16, 63, 116, 0.34), rgba(16, 118, 148, 0.16));
}

.region-grand {
  background: linear-gradient(135deg, rgba(72, 26, 99, 0.32), rgba(33, 50, 110, 0.18));
}

.region-new {
  background: linear-gradient(135deg, rgba(119, 32, 32, 0.28), rgba(134, 72, 19, 0.18));
}

.island-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.island-button {
  text-align: left;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.035);
}

.island-button.current {
  background: rgba(225, 169, 59, 0.15);
  border-color: rgba(225, 169, 59, 0.34);
}

.island-button.active {
  background: rgba(36, 151, 200, 0.14);
  border-color: rgba(36, 151, 200, 0.34);
}

.island-button.locked {
  opacity: 0.38;
}

.list {
  display: grid;
  gap: 12px;
}

.list-item {
  background: rgba(255, 255, 255, 0.03);
}

.list-item.is-clickable {
  cursor: pointer;
}

.rarity-common {
  border-color: rgba(133, 144, 162, 0.24);
}

.rarity-uncommon {
  border-color: rgba(79, 175, 105, 0.28);
  background: rgba(79, 175, 105, 0.06);
}

.rarity-rare {
  border-color: rgba(36, 151, 200, 0.28);
  background: rgba(36, 151, 200, 0.06);
}

.rarity-epic {
  border-color: rgba(194, 125, 255, 0.32);
  background: rgba(194, 125, 255, 0.07);
}

.rarity-legendary {
  border-color: rgba(225, 169, 59, 0.38);
  background: rgba(225, 169, 59, 0.08);
}

.empty {
  padding: 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.028);
  color: var(--muted);
}

.combat-shell {
  display: grid;
  gap: 16px;
}

.combat-top {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.enemy-card {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.combat-actions {
  align-items: stretch;
}

.combat-btn {
  padding: 12px;
  min-width: 118px;
  border-radius: 14px;
  border: 1px solid var(--border);
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.04);
}

.combat-btn.strike {
  background: rgba(223, 79, 79, 0.2);
}

.combat-btn.guard {
  background: rgba(255, 255, 255, 0.03);
}

.combat-btn.haki {
  background: rgba(225, 169, 59, 0.1);
}

.combat-btn.fruit {
  background: rgba(36, 151, 200, 0.1);
}

.log-panel {
  max-height: 230px;
  overflow: auto;
  padding: 14px;
  background: rgba(8, 14, 22, 0.5);
}

.log-panel p {
  margin: 0 0 10px;
  color: rgba(237, 228, 207, 0.86);
  font-size: 0.9rem;
}

.log-panel p:last-child {
  margin-bottom: 0;
}

.create-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.create-card {
  width: min(760px, 100%);
  padding: 30px;
  background: linear-gradient(160deg, rgba(18, 27, 39, 0.98), rgba(26, 35, 48, 0.94));
}

.create-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.backstory-card {
  width: 100%;
  text-align: left;
  padding: 16px;
  border-radius: 16px;
  color: var(--foreground);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.backstory-card.active {
  background: rgba(225, 169, 59, 0.12);
  border-color: rgba(225, 169, 59, 0.36);
}

.spacer-top {
  margin-top: 16px;
}

.section-title {
  font-size: 1.25rem;
  color: var(--foreground);
}

.tiny {
  font-size: 0.8rem;
}

.danger-text {
  color: #ffb8b8;
}

.accent-text {
  color: #7fd7ff;
}

.primary-text {
  color: var(--primary);
}

.success-text {
  color: #9fe0b3;
}

@media (max-width: 920px) {
  .layout,
  .combat-top,
  .grid-4,
  .stats-mini,
  .create-grid,
  .island-grid {
    grid-template-columns: 1fr;
  }

  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .header-bar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

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