:root {
  color-scheme: dark;
  --bg: #120f1d;
  --bg-2: #231837;
  --panel: rgba(31, 25, 48, 0.92);
  --panel-strong: rgba(42, 33, 62, 0.96);
  --gold: #f5c451;
  --gold-2: #ffe39a;
  --red: #e95d64;
  --blue: #5fb7ff;
  --green: #7be28b;
  --text: #fff8df;
  --muted: #c8bda3;
  --line: rgba(245, 196, 81, 0.28);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(245, 196, 81, 0.18), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(95, 183, 255, 0.12), transparent 30rem),
    linear-gradient(145deg, var(--bg), var(--bg-2) 58%, #101321);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.72;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 42px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-banner {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px;
  border: 1px solid var(--line);
  background:
    linear-gradient(rgba(18, 15, 29, 0.2), rgba(18, 15, 29, 0.72)),
    repeating-linear-gradient(135deg, rgba(245, 196, 81, 0.08) 0 2px, transparent 2px 16px),
    linear-gradient(135deg, rgba(72, 42, 112, 0.92), rgba(44, 25, 47, 0.95));
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero-banner::after {
  content: "";
  position: absolute;
  inset: auto 20px 20px auto;
  width: 180px;
  height: 180px;
  border: 2px solid rgba(245, 196, 81, 0.22);
  transform: rotate(45deg);
}

.eyebrow,
.panel-label {
  margin: 0 0 8px;
  color: var(--gold-2);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.8rem, 8vw, 5.8rem);
  line-height: 0.92;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.28), 0 0 28px rgba(245, 196, 81, 0.28);
}

h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
}

.layout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.ad-slot {
  display: grid;
  place-items: center;
  min-height: 96px;
  margin: 0 0 20px;
  border: 1px dashed rgba(255, 227, 154, 0.28);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

.ad-slot-bottom {
  margin: 20px 0 0;
}

.ad-slot span {
  font-size: 0.78rem;
  font-weight: 800;
}

.adsbygoogle {
  width: 100%;
  min-height: 90px;
}

.panel,
.player-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.panel {
  padding: 20px;
}

.player-card {
  padding: 22px;
}

.player-card__top,
.panel-heading,
.exp-row,
.task-actions,
.task-meta,
.modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.level-badge {
  width: 82px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 227, 154, 0.76);
  background: radial-gradient(circle, rgba(245, 196, 81, 0.38), rgba(116, 61, 37, 0.86));
  box-shadow: inset 0 0 18px rgba(255, 243, 196, 0.2), 0 0 24px rgba(245, 196, 81, 0.25);
}

.level-badge span {
  display: block;
  font-size: 0.72rem;
  color: var(--gold-2);
}

.level-badge strong {
  display: block;
  margin-top: -12px;
  font-size: 2rem;
}

.avatar-wrap {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 14px;
}

.player-avatar {
  min-height: 174px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 227, 154, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04), transparent),
    radial-gradient(circle at center, rgba(95, 183, 255, 0.14), transparent 70%);
  overflow: hidden;
}

.player-avatar.large {
  min-height: 230px;
}

.avatar-svg {
  width: 100%;
  max-width: 180px;
  height: auto;
}

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

.stat-grid div {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 227, 154, 0.18);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.stat-grid span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.stat-grid strong {
  color: var(--gold-2);
  font-size: 1.2rem;
}

.exp-row {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.88rem;
}

.exp-bar {
  width: 100%;
  height: 16px;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 227, 154, 0.34);
  background: rgba(0, 0, 0, 0.28);
}

.exp-bar__fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--gold), var(--red));
  box-shadow: 0 0 18px rgba(245, 196, 81, 0.5);
  transition: width 0.35s ease;
}

.quest-form {
  display: grid;
  gap: 14px;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(255, 227, 154, 0.26);
  border-radius: 6px;
  background: rgba(10, 8, 17, 0.72);
  color: var(--text);
  padding: 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 196, 81, 0.14);
}

.primary-button,
.secondary-button,
.danger-button,
.filter-button,
.icon-button {
  min-height: 42px;
  border: 1px solid rgba(255, 227, 154, 0.46);
  border-radius: 6px;
  color: #160e09;
  font-weight: 900;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.24);
}

.secondary-button,
.danger-button,
.filter-button,
.icon-button {
  min-height: 36px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.danger-button {
  border-color: rgba(233, 93, 100, 0.5);
  color: #ffd6d9;
}

.filter-button.is-active {
  color: #160e09;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
}

.full-button {
  width: 100%;
  margin-top: 14px;
}

.compact {
  min-height: 34px;
  padding: 0 12px;
}

.task-panel,
.title-panel {
  min-height: 220px;
}

.title-panel {
  grid-column: 1 / -1;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 20px;
  padding: 20px;
  border: 1px solid rgba(233, 93, 100, 0.42);
  background: rgba(69, 21, 32, 0.58);
  box-shadow: var(--shadow);
}

.danger-zone p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.counter {
  min-width: 38px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold-2);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 900;
}

.toolbar,
.slot-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.task-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.empty-state {
  min-height: 110px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(255, 227, 154, 0.24);
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.task-card {
  padding: 15px;
  border: 1px solid rgba(255, 227, 154, 0.2);
  border-radius: 8px;
  background: var(--panel-strong);
}

.task-card.is-overdue {
  border-color: rgba(233, 93, 100, 0.78);
  background: linear-gradient(135deg, rgba(99, 24, 39, 0.92), rgba(42, 33, 62, 0.96));
  box-shadow: 0 0 24px rgba(233, 93, 100, 0.16);
}

.task-card.is-completed {
  opacity: 0.72;
}

.task-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.task-card p {
  margin-bottom: 12px;
  color: var(--muted);
  line-height: 1.6;
  white-space: pre-wrap;
}

.difficulty {
  display: inline-flex;
  min-width: 100px;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 900;
}

.difficulty.Easy {
  color: #062510;
  background: var(--green);
}

.difficulty.Normal {
  color: #082138;
  background: var(--blue);
}

.difficulty.Hard {
  color: #351207;
  background: var(--gold);
}

.difficulty.Boss {
  color: #fff0f1;
  background: linear-gradient(135deg, #8e1f54, #e95d64);
}

.task-date {
  color: var(--muted);
  font-size: 0.8rem;
}

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

.title-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  padding: 13px;
  border: 1px solid rgba(255, 227, 154, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.title-card.locked {
  filter: grayscale(1);
  opacity: 0.44;
}

.title-card img {
  width: 64px;
  height: 64px;
}

.title-card h3 {
  margin: 0 0 5px;
  font-size: 0.98rem;
}

.title-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.equipment-dialog {
  width: min(940px, calc(100% - 28px));
  max-height: min(820px, calc(100vh - 28px));
  border: 1px solid rgba(255, 227, 154, 0.5);
  border-radius: 8px;
  color: var(--text);
  background: linear-gradient(135deg, rgba(31, 25, 48, 0.98), rgba(18, 15, 29, 0.98));
  box-shadow: var(--shadow);
  padding: 20px;
}

.equipment-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.icon-button {
  width: 40px;
  padding: 0;
  font-size: 1.4rem;
}

.equipment-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  margin-top: 16px;
}

.modal-stats {
  margin-top: 12px;
}

.inventory-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.equipment-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255, 227, 154, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.equipment-item.is-equipped {
  border-color: rgba(123, 226, 139, 0.62);
  background: rgba(123, 226, 139, 0.08);
}

.equipment-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
}

.equipment-item h3 {
  margin: 0 0 5px;
  font-size: 0.98rem;
}

.equipment-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.equipment-actions {
  display: grid;
  gap: 8px;
  min-width: 92px;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  width: min(390px, calc(100% - 32px));
  pointer-events: none;
}

.toast-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(255, 227, 154, 0.72);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(47, 31, 68, 0.98), rgba(72, 31, 43, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.56), 0 0 36px rgba(245, 196, 81, 0.24);
  animation: toastIn 0.4s ease both;
}

.toast-card img,
.toast-svg svg {
  width: 64px;
  height: 64px;
}

.toast-card p {
  margin: 0 0 4px;
  color: var(--gold-2);
  font-weight: 900;
}

.toast-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 940px) {
  .hero,
  .layout,
  .equipment-layout {
    grid-template-columns: 1fr;
  }

  .hero-banner {
    min-height: 170px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 12px;
  }

  .hero,
  .layout {
    gap: 12px;
    margin-bottom: 12px;
  }

  .ad-slot {
    min-height: 72px;
    margin-bottom: 12px;
  }

  .ad-slot-bottom {
    margin-top: 12px;
  }

  .panel,
  .player-card,
  .hero-banner,
  .equipment-dialog {
    padding: 16px;
  }

  .player-card__top,
  .task-actions,
  .task-meta,
  .split-heading,
  .danger-zone {
    align-items: flex-start;
    flex-direction: column;
  }

  .avatar-wrap {
    grid-template-columns: 1fr;
  }

  .level-badge {
    width: 72px;
  }

  .equipment-item {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .equipment-actions,
  .equipment-item button {
    grid-column: 1 / -1;
    width: 100%;
  }
}
