:root {
  --xp-blue-1: #0b3d8a;
  --xp-blue-2: #1f74cf;
  --xp-blue-3: #5fa4f2;
  --steel-1: #141c2c;
  --steel-2: #223554;
  --steel-3: #2f4f7a;
  --panel-bg: #305988;
  --panel-stroke: #98c6ff;
  --ink: #e8f3ff;
  --ink-dim: #bdd8ff;
  --gold: #c48c35;
  --gold-dark: #7a4a10;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans KR", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 16%, rgba(89, 142, 206, 0.75), transparent 36%),
    radial-gradient(circle at 88% 82%, rgba(39, 81, 147, 0.62), transparent 36%),
    linear-gradient(180deg, #4f7dad 0%, #325c8e 36%, #2b4673 100%);
}

.desktop-shell {
  min-width: 1220px;
  padding: 22px 26px;
}

.game-window {
  width: 1240px;
  margin: 0 auto;
  border: 2px solid #8fbef4;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 22px 48px rgba(7, 22, 47, 0.55);
  background: linear-gradient(180deg, #24456f, #1a2f4d);
}

.window-titlebar {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 13px;
  letter-spacing: 0.2px;
  color: #d6eaff;
  background: linear-gradient(180deg, #5aa1f1 0%, #2f7ad1 52%, #155cae 100%);
  border-bottom: 1px solid rgba(6, 25, 48, 0.75);
}

.window-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #9fd0ff;
  box-shadow: 0 0 0 1px rgba(8, 34, 63, 0.75);
}

.status-strip {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: linear-gradient(180deg, #355e8d, #2a4d77);
  border-bottom: 1px solid rgba(130, 181, 243, 0.45);
}

.status {
  flex: 1;
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #8ebfff;
  border-radius: 6px;
  font-family: "Do Hyeon", sans-serif;
  font-size: 20px;
  letter-spacing: 0.2px;
  color: #eef6ff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.42);
  background: linear-gradient(180deg, #2d4f7b, #1d3558);
}

.reset-btn {
  min-width: 112px;
  height: 38px;
  border: 1px solid #80b6ff;
  border-radius: 6px;
  font-family: "Do Hyeon", sans-serif;
  font-size: 18px;
  color: #ecf5ff;
  background: linear-gradient(180deg, #4b90de, #1e68bf);
  cursor: pointer;
}

.reset-btn:hover {
  filter: brightness(1.07);
}

.game-layout {
  display: grid;
  grid-template-columns: 218px 1fr 310px;
  gap: 10px;
  padding: 10px;
}

.scoreboard {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-card {
  border: 1px solid #90c3ff;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(180deg, #274875, #1f3b5f);
  box-shadow: inset 0 0 0 1px rgba(17, 34, 56, 0.45);
}

.player-card.active {
  border-color: #ffd073;
  box-shadow:
    inset 0 0 0 1px rgba(68, 43, 7, 0.65),
    0 0 0 2px rgba(222, 168, 77, 0.35);
}

.player-banner {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-family: "Do Hyeon", sans-serif;
  font-size: 19px;
  color: #eef6ff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
  background: linear-gradient(180deg, #3f699d, #2b4f7b);
  border-bottom: 1px solid rgba(120, 172, 241, 0.5);
}

.player-card.blue .player-banner {
  background: linear-gradient(180deg, #345ca0, #233f73);
}

.player-card.red .player-banner {
  background: linear-gradient(180deg, #8e4d47, #64332f);
}

.player-portrait {
  width: calc(100% - 18px);
  height: 178px;
  margin: 9px;
  border: 1px solid #7faee6;
  border-radius: 6px;
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 0 1px rgba(17, 34, 56, 0.4);
}

.player-card.blue .player-portrait {
  background-image: url("./assets/avatar-left.svg");
}

.player-card.red .player-portrait {
  background-image: url("./assets/avatar-right.svg");
}

.player-gauge {
  margin: 0 9px;
  height: 14px;
  border: 1px solid rgba(26, 39, 58, 0.75);
  border-radius: 8px;
  background: #162536;
  overflow: hidden;
}

.player-gauge span {
  display: block;
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, #48d66d 0%, #6fee8f 45%, #9cffb7 100%);
}

.player-stats {
  padding: 10px 9px 11px;
  display: grid;
  gap: 6px;
}

.player-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #d9e9ff;
}

.player-equip {
  margin-top: 4px;
  min-height: 36px;
  padding: 6px;
  border: 1px solid rgba(120, 164, 224, 0.45);
  border-radius: 4px;
  background: rgba(7, 15, 29, 0.26);
  font-size: 12px;
  color: #b9d3f7;
  line-height: 1.3;
}

.arena-shell {
  position: relative;
  border: 1px solid #85b6ed;
  border-radius: 8px;
  padding: 8px;
  background:
    radial-gradient(circle at 86% 10%, rgba(225, 234, 255, 0.26), transparent 24%),
    linear-gradient(180deg, #121526 0%, #1f2743 55%, #222f47 100%);
  box-shadow: inset 0 0 0 1px rgba(14, 33, 56, 0.6);
}

.arena-top {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 8px;
}

.arena-banner {
  min-width: 320px;
  text-align: center;
  border: 1px solid #a16a23;
  border-radius: 5px;
  padding: 5px 12px 4px;
  font-family: "Do Hyeon", sans-serif;
  font-size: 21px;
  color: #f8e6c6;
  text-shadow: 0 1px 0 rgba(38, 23, 5, 0.8);
  background: linear-gradient(180deg, #5f3913, #2f1a07);
}

.arena-moon {
  position: absolute;
  right: 8px;
  top: -4px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.95), rgba(172, 196, 255, 0.75) 66%, rgba(96, 123, 187, 0.9));
  box-shadow: 0 0 12px rgba(168, 193, 255, 0.7);
}

.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
  padding: 10px;
  border: 2px solid #8b5f2b;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(53, 113, 132, 0.45), rgba(20, 34, 58, 0.35)),
    linear-gradient(180deg, #3d6f75 0 12%, #8b623d 12% 14%, #41542d 14% 28%, #8b623d 28% 30%, #41542d 30% 44%, #8b623d 44% 46%, #3b4f2f 46% 60%, #8b623d 60% 62%, #344533 62% 76%, #8b623d 76% 78%, #27363f 78% 100%);
}

.board::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8px;
  bottom: 8px;
  border: 1px solid rgba(207, 170, 130, 0.35);
  pointer-events: none;
}

.cell {
  position: relative;
  min-height: 58px;
  border: 1px solid rgba(66, 42, 18, 0.85);
  border-radius: 3px;
  background: linear-gradient(180deg, #dfd6c6, #b7a58a);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
}

.cell:hover {
  filter: brightness(1.08);
}

.cell-panel {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(68, 52, 40, 0.36) 0 7%, transparent 7% 93%, rgba(68, 52, 40, 0.36) 93% 100%),
    linear-gradient(180deg, rgba(245, 237, 224, 0.82), rgba(219, 205, 184, 0.78));
}

.cell.hidden .cell-panel {
  background:
    linear-gradient(90deg, rgba(29, 39, 61, 0.7) 0 7%, transparent 7% 93%, rgba(29, 39, 61, 0.7) 93% 100%),
    linear-gradient(180deg, #334153, #232c3a);
}

.cell-label {
  position: absolute;
  left: 5px;
  top: 4px;
  font-size: 10px;
  color: rgba(51, 33, 14, 0.8);
  font-weight: 700;
}

.cell.hidden .cell-label {
  color: rgba(207, 226, 255, 0.65);
}

.cell-fog {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: "Do Hyeon", sans-serif;
  font-size: 26px;
  color: rgba(218, 233, 255, 0.88);
  text-shadow: 0 2px 0 rgba(9, 17, 32, 0.7);
}

.token {
  position: absolute;
  width: 34px;
  height: 34px;
  bottom: 5px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.token.own-token {
  left: 7px;
  background-image: url("./assets/ninja-blue.svg");
}

.token.enemy-token {
  right: 7px;
  background-image: url("./assets/ninja-red.svg");
}

.cell.target {
  box-shadow: inset 0 0 0 2px rgba(68, 151, 255, 0.95);
}

.cell.own {
  border-color: #2a72f7;
}

.cell.enemy {
  border-color: #e64a43;
}

.cell.both {
  border-color: #f5d77f;
}

.cell-collision {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  text-align: center;
  font-family: "Do Hyeon", sans-serif;
  font-size: 16px;
  color: #fff4cc;
  text-shadow: 0 1px 0 rgba(87, 52, 9, 0.9);
}

.turn-controls {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.action-btn {
  height: 38px;
  border: 1px solid #85b5ef;
  border-radius: 6px;
  font-family: "Do Hyeon", sans-serif;
  font-size: 22px;
  color: #eef6ff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.action-btn.move {
  background: linear-gradient(180deg, #3f89de, #1f62b7);
}

.action-btn.attack {
  background: linear-gradient(180deg, #cf604b, #992f22);
}

.action-btn.end {
  background: linear-gradient(180deg, #5f80a4, #385777);
}

.hud-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hud-card {
  border: 1px solid #88baef;
  border-radius: 8px;
  padding: 9px;
  background: linear-gradient(180deg, #315a89, #274973);
}

.hud-card h2 {
  margin: 0 0 8px;
  font-family: "Do Hyeon", sans-serif;
  font-size: 24px;
  color: #e8f4ff;
}

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

.item-btn {
  width: 100%;
  text-align: left;
  border: 1px solid #9bc8ff;
  border-radius: 6px;
  background: linear-gradient(180deg, #f6fbff, #d5e6f8);
  color: #1f3450;
  padding: 6px 7px;
  cursor: pointer;
}

.item-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.item-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "Do Hyeon", sans-serif;
  font-size: 19px;
}

.item-meta {
  margin-top: 2px;
  font-size: 11px;
  color: #2f4664;
}

.message-log {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 210px;
  overflow: auto;
  display: grid;
  gap: 5px;
}

.message-log li {
  border: 1px solid rgba(144, 194, 255, 0.48);
  border-radius: 5px;
  background: rgba(9, 22, 41, 0.33);
  padding: 5px 7px;
  font-size: 13px;
  color: #d0e4ff;
}

.legend p {
  margin: 4px 0;
  font-size: 13px;
  color: #c8ddfb;
}
