:root {
  --bg-1: #b9dcff;
  --bg-2: #f4f8ff;
  --panel: rgba(255, 255, 255, 0.85);
  --ink: #18314f;
  --accent: #f26b38;
  --ok: #0f9d58;
  --danger: #bf1f3d;
  --tile: #fdf8ee;
  --tile-border: #cfbfa6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 10% 15%, #ffe0bc, transparent 36%),
    radial-gradient(circle at 86% 20%, #c9f3d9, transparent 34%),
    linear-gradient(170deg, var(--bg-1), var(--bg-2));
}

#app {
  padding: 16px;
}

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

.topbar h1 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: 0.04em;
}

.status {
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(24, 49, 79, 0.12);
}

.layout {
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  gap: 12px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(24, 49, 79, 0.12);
  border-radius: 14px;
  box-shadow: 0 14px 32px rgba(11, 24, 44, 0.18);
  padding: 12px;
}

.hidden {
  display: none !important;
}

.block {
  border-top: 1px solid rgba(24, 49, 79, 0.12);
  padding-top: 10px;
  margin-top: 10px;
}

form {
  display: grid;
  gap: 8px;
}

label {
  display: grid;
  gap: 4px;
  font-size: 0.88rem;
}

input {
  border: 1px solid rgba(24, 49, 79, 0.25);
  border-radius: 10px;
  padding: 9px;
  font: inherit;
}

button {
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  background: linear-gradient(140deg, #ff8b4a, var(--accent));
  color: white;
  cursor: pointer;
  font-weight: 700;
}

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

.actions {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.hostCard {
  margin: 10px 0;
  padding: 10px;
  border: 1px dashed rgba(24, 49, 79, 0.22);
  border-radius: 10px;
}

.hostCard code {
  display: block;
  margin: 8px 0;
  padding: 8px;
  border-radius: 8px;
  background: #122741;
  color: #d6f4df;
  font-size: 1rem;
  letter-spacing: 0.16em;
}

.players,
.events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.players li,
.events li {
  padding: 8px;
  border-radius: 8px;
  background: rgba(24, 49, 79, 0.07);
}

.players li.current {
  outline: 2px solid rgba(242, 107, 56, 0.6);
}

.player-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.board-wrap {
  min-height: 700px;
}

.turnBar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 8px;
  border-radius: 10px;
  background: linear-gradient(130deg, rgba(242, 107, 56, 0.2), rgba(15, 157, 88, 0.2));
  font-weight: 700;
}

.board-iso {
  position: relative;
  margin: 18px auto;
  width: min(780px, 90vw);
  height: min(780px, 90vw);
  transform-style: preserve-3d;
  transform: perspective(1100px) rotateX(56deg) rotateZ(45deg);
  background: linear-gradient(150deg, #d9ffe4, #f2ffe9);
  border-radius: 22px;
  box-shadow: inset 0 0 0 14px #8d7a61, inset 0 0 0 32px #f4ece0;
}

.tile {
  position: absolute;
  width: calc(100% / 7 - 6px);
  height: calc(100% / 7 - 6px);
  background: var(--tile);
  border: 1px solid var(--tile-border);
  border-radius: 8px;
  padding: 4px;
  transform: translateZ(18px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 10px;
  overflow: hidden;
}

.tile.current {
  box-shadow: 0 0 0 3px rgba(242, 107, 56, 0.65);
}

.tile-header {
  font-weight: 700;
  line-height: 1.05;
}

.tile-sub {
  opacity: 0.78;
  font-size: 9px;
}

.tile-owner {
  font-size: 8px;
  opacity: 0.8;
}

.tokens {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}

.token {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  font-size: 9px;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.center {
  position: absolute;
  top: 28%;
  left: 28%;
  width: 44%;
  height: 44%;
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.86), rgba(219, 255, 232, 0.92));
  border: 1px dashed rgba(24, 49, 79, 0.25);
  display: grid;
  place-items: center;
  font-weight: 700;
}

.toast {
  position: fixed;
  top: 14px;
  right: 14px;
  background: rgba(191, 31, 61, 0.95);
  color: white;
  padding: 9px 12px;
  border-radius: 8px;
  z-index: 100;
}

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

  .board-wrap {
    min-height: 460px;
  }

  .board-iso {
    width: min(92vw, 620px);
    height: min(92vw, 620px);
  }
}
