/* Catur Noir — tema noir mewah: vignette, emas + merah tua, Cinzel. */
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url('/fonts/cinzel-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url('/fonts/cinzel-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
  }

  [hidden] {
    display: none !important;
  }

  :root {
  --bg: #0b0a09;
  --panel: #151312;
  --panel-2: #1c1917;
  --panel-card: rgba(26, 23, 21, 0.85);
  --border: #2c2825;
  --border-hi: #3f3833;
  --text: #ece7df;
  --muted: #97908a;
  --accent: #b3202a;
  --accent-hi: #d94550;
  --gold: #d4a017;
  --gold-dim: #8a6d1d;
  --ok: #4caf50;
  --sq-light: #a89f92;
  --sq-dark: #45403b;
  --cs: min(11.2vw, 56px);
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  min-height: 100vh;
  background:
    radial-gradient(1200px 700px at 50% -10%, #1a1712 0%, transparent 60%),
    radial-gradient(900px 500px at 85% 110%, #140f0e 0%, transparent 55%),
    var(--bg);
}
::selection { background: rgba(179, 32, 42, .4); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

h1, h2, .brand, .brand-text { font-family: 'Cinzel', Georgia, serif; }

/* ---------- LOBI ---------- */
.lobby { max-width: 460px; margin: 0 auto; padding: clamp(28px, 7vh, 72px) 20px 40px; }
.lobby h1 {
  font-size: clamp(2.2rem, 8vw, 3rem);
  letter-spacing: .06em;
  margin: 0;
  text-align: center;
  user-select: none;
  cursor: default;
  color: var(--text);
  text-shadow: 0 2px 12px rgba(0, 0, 0, .6);
}
.lobby h1 span { color: var(--accent-hi); }
.tagline {
  text-align: center;
  color: var(--muted);
  margin: 10px 0 6px;
  letter-spacing: .04em;
}
.rule {
  width: 130px; height: 1px; margin: 14px auto 30px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}
.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  transition: border-color .2s;
}
.card:hover { border-color: var(--border-hi); }
.card h2 {
  display: flex; align-items: center; gap: 8px;
  font-size: .82rem; margin: 0 0 14px; color: var(--gold);
  font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
}
.card h2 svg { width: 15px; height: 15px; stroke: var(--gold); fill: none; stroke-width: 1.8; flex: none; }
.row { display: flex; gap: 8px; }
input, select {
  flex: 1; min-width: 0;
  background: #0e0d0c;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color .15s;
}
input:focus, select:focus { border-color: var(--gold-dim); outline: none; }
input#inp-code { text-transform: uppercase; letter-spacing: .35em; text-align: center; font-weight: bold; }

button {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 11px 18px;
  font-size: .95rem;
  font-family: inherit;
  cursor: pointer;
  transition: transform .12s, border-color .15s, background .15s, box-shadow .15s;
}
button:hover { border-color: var(--accent); transform: translateY(-1px); }
button:active { transform: translateY(0); }
button:disabled { opacity: .45; cursor: default; transform: none; }
button.primary {
  width: 100%;
  background: linear-gradient(180deg, #a92531, #7e1721);
  border-color: #d9455066;
  font-weight: bold;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .88rem;
  box-shadow: 0 4px 16px rgba(179, 32, 42, .25);
}
button.primary:hover { box-shadow: 0 6px 20px rgba(179, 32, 42, .4); border-color: var(--accent-hi); }
.lobby-foot { text-align: center; color: #6b655f; font-size: .8rem; margin-top: 26px; letter-spacing: .05em; }

/* ---------- ARENA (GAME) ---------- */
.game {
  max-width: calc(var(--cs) * 8 + 48px);
  margin: 0 auto;
  padding: 12px 14px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Header Arena */
.arena-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0 6px;
}
.btn-lobby {
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.btn-lobby:hover { color: var(--text); border-color: var(--border); }
.arena-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-text {
  font-size: 1.1rem;
  letter-spacing: .05em;
  font-weight: 700;
}
.brand-text span { color: var(--accent-hi); }
.room-pill {
  font-size: .78rem;
  letter-spacing: .15em;
  color: var(--gold);
  background: rgba(212, 160, 23, 0.12);
  border: 1px solid var(--gold-dim);
  padding: 2px 8px;
  border-radius: 12px;
  font-family: ui-monospace, monospace;
}
.btn-header-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: .82rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--gold);
  border-radius: 6px;
}
.btn-header-action:hover { border-color: var(--gold); }

/* Share Card */
.share-box {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px dashed var(--gold-dim);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  animation: rise .2s ease-out;
}
.share-title {
  font-size: .85rem;
  font-weight: bold;
  color: var(--gold);
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.share-desc {
  color: var(--muted);
  font-size: .82rem;
  margin-bottom: 8px;
}
.share-row {
  display: flex;
  gap: 8px;
}
.share-row input {
  font-size: .84rem;
  color: var(--gold);
  padding: 8px 10px;
}
.share-row button {
  padding: 8px 14px;
  font-size: .84rem;
  background: linear-gradient(180deg, #a92531, #7e1721);
  border-color: #d9455066;
  font-weight: bold;
  white-space: nowrap;
}

/* Status Bar */
.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: .88rem;
  color: var(--text);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  margin-bottom: 2px;
}
.status-bar .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}
.status-bar.mine .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.status-bar.wait .dot { background: var(--gold); box-shadow: 0 0 8px var(--gold); animation: breathe 1.6s infinite; }
.status-bar.check .dot { background: var(--accent-hi); box-shadow: 0 0 8px var(--accent-hi); }
.status-bar.over .dot { background: var(--muted); }
@keyframes breathe { 50% { opacity: .35; } }

/* ---------- KARTU PEMAIN (USER & LAWAN) ---------- */
.player-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  transition: border-color .2s, box-shadow .2s;
}
.player-card.active-turn {
  border-color: var(--gold-dim);
  box-shadow: 0 0 12px rgba(212, 160, 23, 0.18);
}
.player-card.my-turn {
  border-color: rgba(76, 175, 80, 0.6);
  box-shadow: 0 0 12px rgba(76, 175, 80, 0.2);
}
.player-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.player-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #231f1c;
  border: 1px solid var(--border-hi);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}
.player-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.player-name-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.player-name {
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-color-tag {
  font-size: .72rem;
  font-weight: normal;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}
.player-color-tag.w { background: #e8e3d8; color: #111; font-weight: bold; }
.player-color-tag.b { background: #262422; color: #d8d3cb; border: 1px solid #444; font-weight: bold; }

.player-captures {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: .78rem;
  min-height: 18px;
  color: var(--muted);
}
.cap-item {
  font-size: .95rem;
  line-height: 1;
  opacity: .85;
}
.cap-lead {
  font-size: .74rem;
  font-weight: bold;
  color: var(--gold);
  margin-left: 3px;
  font-family: ui-monospace, monospace;
}

.player-turn-pill {
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .06em;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(212, 160, 23, 0.15);
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  animation: pulsePill 1.6s infinite;
  white-space: nowrap;
}
.player-card.my-turn .player-turn-pill {
  background: rgba(76, 175, 80, 0.15);
  color: var(--ok);
  border-color: rgba(76, 175, 80, 0.5);
}
@keyframes pulsePill { 50% { opacity: .5; } }

/* ---------- PAPAN CATUR ---------- */
.board-frame {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2px 0;
}
.board-wrap {
  display: grid;
  grid-template-columns: 18px auto;
  grid-template-rows: auto 18px;
  gap: 4px;
  width: fit-content;
  margin: 0 auto;
}
#ranks, #files {
  display: flex;
  color: var(--muted);
  font-size: .68rem;
  font-family: ui-monospace, monospace;
  user-select: none;
}
#ranks {
  grid-area: 1 / 1;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  padding: 2px 0;
}
#files {
  grid-area: 2 / 2;
  justify-content: space-around;
  padding: 0 2px;
}

#board {
  grid-area: 1 / 2;
  display: grid;
  grid-template-columns: repeat(8, var(--cs));
  grid-template-rows: repeat(8, var(--cs));
  border: 1px solid #4a423a;
  outline: 4px solid #191613;
  outline-offset: 0;
  box-shadow: 0 0 0 5px #2c2723, 0 18px 40px rgba(0, 0, 0, .55);
  user-select: none;
  touch-action: manipulation;
  border-radius: 2px;
}
.cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: var(--cs);
  height: var(--cs);
}
.cell.light { background: linear-gradient(135deg, var(--sq-light), #948b7e); }
.cell.dark { background: linear-gradient(135deg, var(--sq-dark), #37332e); }
.cell.sel { outline: 3px solid var(--accent-hi); outline-offset: -3px; z-index: 2; }
.cell.last { box-shadow: inset 0 0 0 2px rgba(212, 160, 23, .55); }
.cell.hint {
  box-shadow: inset 0 0 0 1.5px rgba(212, 160, 23, 0.22);
  background: rgba(212, 160, 23, 0.04);
  z-index: 2;
}

.board-arrows {
  grid-area: 1 / 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

/* King in check */
.cell.check-sq {
  background: radial-gradient(circle, rgba(217, 69, 80, 0.85) 0%, rgba(179, 32, 42, 0.45) 60%, transparent 80%) !important;
  animation: checkPulse 1s infinite alternate;
  z-index: 2;
}
@keyframes checkPulse {
  from { box-shadow: inset 0 0 8px rgba(217, 69, 80, 0.6); }
  to { box-shadow: inset 0 0 16px rgba(217, 69, 80, 0.95); }
}

/* Legal Move Targets */
.cell.tgt::after {
  content: "";
  position: absolute;
  width: 24%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(179, 32, 42, .65);
  box-shadow: 0 0 6px rgba(179, 32, 42, .5);
  pointer-events: none;
}
.cell.tgt.occ::after {
  width: 90%;
  height: 90%;
  border-radius: 4px;
  background: transparent;
  border: 3px solid rgba(179, 32, 42, .75);
  box-shadow: none;
  pointer-events: none;
}

.pc {
  width: 86%;
  height: 86%;
  pointer-events: none;
  user-select: none;
}
.pc.w { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }
.pc.b { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }

/* ---------- FOOTER: RIWAYAT & AKSI ---------- */
.arena-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.moves-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: var(--shadow);
  font-family: ui-monospace, monospace;
  font-size: .84rem;
}
.moves-label {
  color: var(--gold);
  font-size: .75rem;
  font-weight: bold;
  letter-spacing: .08em;
  text-transform: uppercase;
  flex: none;
}
#moves {
  color: var(--muted);
  overflow-x: auto;
  white-space: nowrap;
  flex: 1;
  scrollbar-width: none;
}
#moves::-webkit-scrollbar { display: none; }

.footer-actions {
  display: flex;
  gap: 8px;
}
.btn-tool {
  flex: 1;
  padding: 10px 14px;
  font-size: .88rem;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-hint {
  background: linear-gradient(180deg, #2a2318, #1c1710);
  border-color: var(--gold-dim);
  color: var(--gold);
}
.btn-hint:hover {
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(212, 160, 23, .25);
}
.btn-flip {
  background: var(--panel-2);
  border-color: var(--border);
  color: var(--muted);
}
.btn-flip:hover {
  border-color: var(--border-hi);
  color: var(--text);
}
.btn-resign {
  background: var(--panel-2);
  border-color: var(--border);
  color: var(--accent-hi);
}
.btn-resign:hover {
  border-color: var(--accent-hi);
  box-shadow: 0 0 10px rgba(217, 69, 80, .25);
}

/* ---------- TOAST ---------- */
#toast-box {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  width: min(92vw, 380px);
  pointer-events: none;
}
.toast {
  background: linear-gradient(180deg, #201c19, #151312);
  border: 1px solid var(--border-hi);
  border-left: 3px solid var(--accent);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .6);
  font-size: .9rem;
  animation: rise .25s ease-out;
  pointer-events: auto;
}
.toast.good { border-left-color: var(--ok); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
@media (max-width: 480px) {
  :root { --cs: min(11.2vw, 44px); }
  .game { padding: 6px 8px 20px; gap: 6px; }
  .card { padding: 14px; }
  .player-card { padding: 6px 10px; }
  .player-avatar { width: 30px; height: 30px; font-size: 1rem; }
  .status-bar { padding: 6px 12px; font-size: .84rem; }
  .arena-title .brand-text { font-size: 1rem; }
}

/* ---------- KONTROL TAMBAHAN LOBI ---------- */
.lobby-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.field-label {
  font-size: .78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.elo-badge {
  font-size: .78rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(212, 160, 23, 0.12);
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  padding: 2px 8px;
  letter-spacing: .03em;
}
.elo-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  margin: 6px 0 2px;
}
.elo-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid #fff;
  box-shadow: 0 0 8px rgba(212, 160, 23, 0.6);
  cursor: pointer;
  transition: transform .1s ease;
}
.elo-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
.elo-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid #fff;
  box-shadow: 0 0 8px rgba(212, 160, 23, 0.6);
  cursor: pointer;
}
.elo-ticks {
  display: flex;
  justify-content: space-between;
  font-size: .72rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------- JAM CATUR (CLOCK) ---------- */
.player-clock {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 1rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  color: var(--text);
  min-width: 58px;
  text-align: center;
}
.player-card.active-turn .player-clock {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212, 160, 23, 0.1);
}
.player-clock.low {
  border-color: var(--accent-hi) !important;
  color: var(--accent-hi) !important;
  animation: clockPanic 0.8s infinite alternate;
}
@keyframes clockPanic {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

/* ---------- BANNER PENAWARAN (REMIS / REMATCH) ---------- */
.offer-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(180deg, #2a2212, #1b160b);
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-size: .86rem;
  animation: rise .2s ease-out;
}
.offer-banner:not([hidden]) {
  display: flex;
}
.offer-banner[hidden] {
  display: none !important;
}
.offer-actions {
  display: flex;
  gap: 6px;
}
.btn-sm {
  padding: 4px 10px;
  font-size: .8rem;
  border-radius: 4px;
  font-weight: 600;
}
.btn-accept {
  background: var(--ok);
  color: #0b0a09;
  border: none;
}
.btn-accept:hover { filter: brightness(1.15); }
.btn-decline {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--muted);
}
.btn-decline:hover { color: var(--text); border-color: var(--border-hi); }

/* ---------- FOOTER ACTIONS EXTENDED ---------- */
.footer-actions-secondary {
  display: none;
  gap: 6px;
  margin-top: 4px;
}
.footer-actions-secondary:not([hidden]) {
  display: flex;
}
.footer-actions-secondary[hidden] {
  display: none !important;
}
.btn-tool-sm {
  flex: 1;
  padding: 8px 10px;
  font-size: .82rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: inherit;
  font-weight: 600;
}
.btn-tool-sm:hover {
  border-color: var(--border-hi);
  color: var(--text);
}
.btn-tool-accent {
  background: linear-gradient(180deg, #8f202a, #68121a);
  border-color: #d9455066;
  color: #fff;
}
.btn-tool-accent:hover {
  border-color: var(--accent-hi);
}

/* ---------- MODAL PROMOSI BIDAK ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn .15s ease-out;
}
.modal-backdrop:not([hidden]) {
  display: flex;
}
.modal-backdrop[hidden] {
  display: none !important;
}
.modal-box {
  background: var(--panel);
  border: 1px solid var(--border-hi);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
  text-align: center;
  max-width: 320px;
  width: 90%;
}
.modal-title {
  font-size: .92rem;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: .05em;
  margin-bottom: 12px;
  text-transform: uppercase;
}
.promo-choices {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.promo-btn {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .1s, border-color .1s, background-color .1s;
}
.promo-btn:hover {
  border-color: var(--gold);
  background: rgba(212, 160, 23, 0.12);
  transform: scale(1.08);
}
.promo-btn img {
  width: 80%;
  height: 80%;
  pointer-events: none;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- DRAG & DROP GHOST ---------- */
#drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 999;
  transform: translate(-50%, -50%);
  width: calc(var(--cs) * 0.9);
  height: calc(var(--cs) * 0.9);
  display: none;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.6));
}
.cell.dragging .pc {
  opacity: 0.15;
}
