/* базовые */
* { box-sizing: border-box; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial; }
body {
  margin: 0;
  min-height: 100vh;
  color: #e9e9ef;

  background-image: url("assets/backgrounds/game-bg.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;

  background-color: #06070d;
}

.wrap { max-width: 1260px; margin: 0 auto; padding: 18px; }
header { display:flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
h1 { margin: 0; font-size: 20px; }

.panel {
  background: rgba(10, 12, 20, 0.78);
  border: 1px solid #2a2f3e;
  border-radius: 12px;
  padding: 14px;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.hidden { display:none; }
.row { display:flex; gap:10px; align-items:center; margin-top: 10px; flex-wrap: wrap; }

input, select {
  background:#0f1118; color:#fff; border: 1px solid #2a2f3e;
  padding:10px 12px; border-radius: 10px; outline:none;
}

button { background:#2b62ff; color:#fff; border:none; border-radius: 10px; padding:10px 12px; cursor:pointer; }
button:hover { opacity: 0.92; }
button:disabled { opacity: 0.45; cursor: not-allowed; }

.hint { color:#aab0c3; margin-top: 10px; font-size: 13px; }

.topbar { display:flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.actions { display:flex; gap:10px; align-items:flex-start; }

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

.side {
  border:1px solid #2a2f3e;
  border-radius: 12px;
  padding: 10px;
  background: rgba(10, 12, 20, 0.70);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.side-title { font-weight: 800; margin-bottom: 8px; }
.side-sub { margin-top: 8px; color:#cbd2ea; font-size: 13px; }

.center {
  border:1px solid #2a2f3e;
  border-radius: 12px;
  padding: 10px;
  background: rgba(10, 12, 20, 0.70);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* ======= action box ======= */
.action-box{
  border:1px solid #2a2f3e;
  border-radius: 12px;
  padding: 10px;
  background: rgba(10, 12, 20, 0.55);
  margin-bottom: 10px;
}
.action-title { font-weight: 800; margin-bottom: 8px; }
.action-row { display:flex; gap: 12px; }
.act-col { flex: 1; }
.act-who { font-weight: 700; margin-bottom: 6px; color:#cbd2ea; }
.act-cards { display:flex; gap: 10px; flex-wrap: wrap; }

.mini-card {
  width: 74px; height: 104px;
  border-radius: 12px;
  border: 1px solid #2a2f3e;
  overflow: hidden;
  background: rgba(0,0,0,0.25);
  position: relative;
}
.mini-card img { width:100%; height:100%; object-fit: contain; display:block; }
.mini-card .lab {
  position:absolute; bottom: 4px; left: 6px; right: 6px;
  font-size: 10px; color: #fff; text-shadow: 0 1px 2px #000;
}

/* ======= СТОЛ ======= */
.table-board {
  position: relative;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  aspect-ratio: 1280 / 720;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #2a2f3e;
  background: #0b0e15;
}

.table-board img.board-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 3x3 зона: 8 слотов вокруг + колода центр */
.table-grid {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 68%;
  height: 68%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 18px;
}

/* боковые слоты */
.side-slots {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 12%;
  height: 62%;
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 14px;
}
.side-slots.side-left { left: 4%; }
.side-slots.side-right { right: 4%; }

/* каждая ячейка — контейнер */
.slot {
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* “под карту” (чтобы не было срезов) */
.slot .cardframe,
.slot img {
  width: 100%;
  height: 100%;
}

/* ✅ не режем */
.slot img {
  object-fit: contain;
  display: block;
}

.slot .label {
  position:absolute; bottom: 6px; left: 10px; right: 10px;
  font-size: 12px;
  color:#fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.9);
  pointer-events: none;
}

/* пустой слот */
.slot.empty {
  border: 2px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.03);
}
.slot.empty.placeable {
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.55);
  box-shadow: 0 0 18px rgba(255,255,255,0.35);
}

.slot.match {
  outline: 4px solid rgba(0, 208, 132, 0.9);
  outline-offset: 2px;
  cursor: pointer;
}

/* колода */
.slot.deck {
  border: 2px solid rgba(255,255,255,0.18);
  box-shadow: 0 0 14px rgba(0,0,0,0.45);
}
.slot.deck.clickable {
  cursor: pointer;
  box-shadow: 0 0 22px rgba(70, 140, 255, 0.55);
}

/* ======= РУКА ======= */
.hand-area {
  margin-top: 12px;
  border:1px solid #2a2f3e;
  border-radius: 12px;
  padding: 10px;
  background: rgba(10, 12, 20, 0.55);
}

.hand-cards { display:flex; flex-wrap: wrap; gap: 10px; }

.card {
  width: 96px;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  border: 1px solid #2a2f3e;
  overflow:hidden;
  cursor:pointer;
  position: relative;
  background: rgba(0,0,0,0.20);
}

.card img { width:100%; height:100%; object-fit: contain; display:block; }

.card .label {
  position:absolute; bottom: 4px; left: 6px; right: 6px;
  font-size: 11px; color: #fff;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
}

.card.selected { outline: 3px solid #00d084; }

/* ===== Collection Panel ===== */
.collection-panel {
  position: relative;
  width: 100%;
  aspect-ratio: 1222 / 2048;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #2a2f3e;
  background: #0b0e15;
}

.collection-panel img.bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cp-star {
  position: absolute;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  opacity: 0.18;
}
.cp-star.on { opacity: 1; filter: drop-shadow(0 0 8px rgba(255, 220, 0, 0.75)); }

.cp-simple-count {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 900;
  font-size: 44px;
  color: #ffe35a;
  text-shadow: 0 2px 6px rgba(0,0,0,0.7);
}

.cp-sorc {
  position: absolute;
  width: 62px;
  height: 62px;
  transform: translate(-50%, -50%);
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.35);
  background: rgba(0,0,0,0.15);
  opacity: 0.18;
}
.cp-sorc.on { opacity: 1; filter: drop-shadow(0 0 10px rgba(255,255,255,0.35)); }
.cp-sorc img { width: 100%; height:100%; object-fit: cover; display:block; }
