/* table-game.css: Crapette / Russian Bank on the standard game page.
   Cards, felt, toolbar and rail come from game.css, home-game.css and
   play-layout.css; this file only adds the table's slots, highlights,
   status panel and the start dialog. Positions are set by js/table-game.js. */

.table-game-page #board { position: relative; overflow: hidden; touch-action: manipulation; }
.table-game-page #card-layer .card { transform-origin: 0 0; }
.table-game-page #card-layer .card:focus-visible { outline: 3px solid #f6d77a; outline-offset: 2px; border-radius: 6px; }

.tg-slot {
  position: absolute; top: 0; left: 0; transform-origin: 0 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: #ffffff1c; border: 1px solid #ffffff12; border-radius: 6px;
  color: #ffffffb3; text-align: center; pointer-events: auto; user-select: none;
  font: 700 clamp(9px, calc(var(--cw) * 0.13), 14px)/1.15 system-ui, sans-serif;
}
.tg-slot-mark { font-size: 2.1em; line-height: 1; opacity: .55; font-family: Georgia, serif; }
.tg-slot-mark:empty { display: none; }
.tg-slot-caption { padding: 0 3px; opacity: .8; }
.tg-slot-column { background: transparent; border: 1px dashed #ffffff2e; }
.tg-slot.tg-clickable { cursor: pointer; }

.table-game-page #card-layer .card.tg-movable { cursor: grab; }
.table-game-page #card-layer .card.tg-clickable { cursor: pointer; }
.card.tg-selected::before, .card.tg-target::before, .tg-slot.tg-target::before {
  content: ''; position: absolute; inset: -3px; border-radius: 8px; pointer-events: none; z-index: 2;
}
.card.tg-selected::before { box-shadow: 0 0 0 3px #f6d77a, 0 0 16px 2px #f6d77a99; }
.card.tg-target::before, .tg-slot.tg-target::before { border: 3px dashed #f6d77a; background: #f6d77a1f; }
.card.dragging { z-index: 2000 !important; }
.card.dragging .card-face { box-shadow: 0 14px 26px #00000073; }

.tg-count {
  position: absolute; top: 0; left: 0; z-index: 950; pointer-events: none;
  translate: -50% -50%; min-width: 22px; padding: 2px 6px; border-radius: 999px;
  background: #102d1c; color: #fff; border: 1px solid #ffffff40;
  font: 700 11px/1.3 system-ui, sans-serif; text-align: center;
}

.tg-opp, .tg-panel { position: absolute; z-index: 5; color: #fff; font-family: system-ui, sans-serif; }
.tg-opp { display: flex; flex-direction: column; justify-content: center; gap: 3px; padding-left: 4px; overflow: hidden; }
.tg-opp strong { font-size: clamp(12px, calc(var(--cw) * 0.15), 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-opp span { font-size: clamp(11px, calc(var(--cw) * 0.12), 14px); opacity: .78; white-space: nowrap; }
.tg-opp.active strong::before, .tg-panel.active #tg-status::before {
  content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%;
  background: #f6d77a; box-shadow: 0 0 0 3px #f6d77a40; vertical-align: middle;
}

.tg-panel .tg-actions { pointer-events: auto; }
.tg-panel { display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 0 4px 0 10px; }
.tg-panel.band { flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px; }
#tg-status { margin: 0; font-size: clamp(12px, calc(var(--cw) * 0.14), 16px); font-weight: 650; line-height: 1.3; text-shadow: 0 1px 2px #0005; }
.tg-panel.band #tg-status { font-size: 13px; flex: 1; min-width: 0; }
.tg-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tg-panel.band .tg-actions { flex-wrap: nowrap; }
.tg-action {
  min-height: 38px; padding: 8px 16px; border: 0; border-radius: 999px; cursor: pointer;
  background: #f6e7b0; color: #173d24; font: 800 14px/1 system-ui, sans-serif;
  box-shadow: 0 2px 0 #00000033;
}
.tg-panel.band .tg-action { min-height: 32px; padding: 7px 12px; font-size: 13px; white-space: nowrap; }
.tg-action:hover { background: #fff1c4; }
.tg-action:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.tg-start {
  position: absolute; inset: 0; z-index: 1500; display: grid; place-items: center; padding: 16px;
  background: #0b2a1866;
}
.tg-start[hidden] { display: none; }
.tg-start-card {
  width: min(420px, 100%); padding: 24px 24px 20px; border-radius: 14px; text-align: center;
  background: #fffdf6; color: #1d3b26; box-shadow: 0 18px 44px #00000059;
  font-family: system-ui, sans-serif;
}
.tg-start-card h2 { margin: 0 0 8px; font-size: 22px; line-height: 1.2; }
.tg-start-text { margin: 0 0 16px; font-size: 15px; line-height: 1.45; color: #3b5443; }
.tg-levels { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 16px; border-radius: 999px; background: #e7eedd; }
.tg-levels button {
  padding: 8px 14px; border: 0; border-radius: 999px; background: transparent; color: #2c4a35;
  font: 700 14px/1 system-ui, sans-serif; cursor: pointer; text-transform: capitalize;
}
.tg-levels button.active { background: #1f6b43; color: #fff; }
.tg-deal {
  display: block; width: 100%; min-height: 48px; border: 0; border-radius: 999px; cursor: pointer;
  background: #f2c94c; color: #1d3b26; font: 800 17px/1 system-ui, sans-serif; box-shadow: 0 3px 0 #b8902a;
}
.tg-deal:hover { background: #f6d56b; }
.tg-deal:disabled { opacity: .6; cursor: progress; }
.tg-start-notice { min-height: 1.3em; margin: 10px 0 0; font-size: 14px; color: #8a2f20; }
.tg-start-notice:empty { margin: 0; min-height: 0; }
.tg-other[hidden] { display: none; }
.tg-other { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.tg-other a, .tg-other button {
  padding: 8px 14px; border-radius: 999px; border: 1px solid #1f6b43; background: #fff;
  color: #1f6b43; font: 700 14px/1.2 system-ui, sans-serif; text-decoration: none; cursor: pointer;
}
.tg-online { display: inline-block; margin-top: 14px; font-size: 14px; color: #1f6b43; font-weight: 600; }
.home-more-panel .tg-more-btn { width: 100%; justify-content: flex-start; }

@media (prefers-reduced-motion: reduce) {
  .table-game-page #card-layer .card.anim { transition: none; }
}
