/* Canasta table — Playnesta original (MIT, see LICENSE.txt). */
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  background: #0b2018;
  color: #f2ede3;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
body {
  min-height: 100vh;
  min-height: calc(var(--pn-vh, 1vh) * 100);
  user-select: none;
  -webkit-user-select: none;
}
#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100vh;
  min-height: calc(var(--pn-vh, 1vh) * 100);
}
.hidden {
  display: none !important;
}
i {
  opacity: 0.5;
  font-style: normal;
}

/* topbar */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  background: #10362a;
  border: 1px solid #1e4d3d;
  border-radius: 10px;
  padding: 8px 12px;
}
.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
}
.brand small {
  font-weight: 400;
  opacity: 0.55;
  margin-left: 4px;
}
.meta {
  font-size: 12px;
  opacity: 0.9;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.scoreboard {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.chip {
  background: #0b2018;
  border: 1px solid #2b5a48;
  border-radius: 8px;
  padding: 3px 9px;
  font-size: 13px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.chip b {
  font-size: 15px;
}
.chip.me {
  border-color: #e3b341;
}
.chip .to {
  opacity: 0.55;
  font-size: 11px;
}

/* auction bar */
.bidbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  background: #10362a;
  border: 1px solid #1e4d3d;
  border-radius: 10px;
  padding: 8px 12px;
}
.bid-info {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
}
.bid-info b {
  color: #e3b341;
  font-size: 15px;
}
.bid-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.btn {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid #2b5a48;
  background: #10362a;
  color: #f2ede3;
  font-size: 14px;
  cursor: pointer;
}
.btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.btn.primary {
  background: #e3b341;
  border-color: #e3b341;
  color: #221a06;
  font-weight: 700;
}
.btn.tiny {
  min-height: 30px;
  padding: 3px 10px;
  font-size: 12px;
}
.btn.suit-btn {
  font-size: 24px;
  min-width: 64px;
}

/* meld bar */
.meldbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  background: #10362a;
  border: 1px solid #1e4d3d;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
}
.meld-me,
.meld-opp {
  display: flex;
  align-items: center;
  gap: 8px;
}
.meld-me span,
.meld-opp span {
  opacity: 0.8;
}
.meld-me b,
.meld-opp b {
  color: #e3b341;
  font-size: 15px;
}
.bid-contract {
  margin-left: auto;
  opacity: 0.85;
}
.bid-contract b {
  color: #e3b341;
}

/* table */
.table {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.opp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: #10362a;
  border: 1px solid #1e4d3d;
  border-radius: 10px;
  padding: 8px 12px;
}
.opp-row.active {
  border-color: #e3b341;
}
.opp .who {
  font-weight: 700;
  font-size: 13px;
}
.opp .count {
  margin-left: 8px;
  font-size: 12px;
  opacity: 0.8;
}
.opp-cards {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  max-width: 320px;
}
.back {
  width: 20px;
  height: 29px;
  border-radius: 3px;
  background: repeating-linear-gradient(45deg, #1e4d3d 0 4px, #16402f 4px 8px);
  border: 1px solid #2b5a48;
}
.stock {
  margin-left: auto;
  font-size: 12px;
  opacity: 0.85;
  background: #0b2018;
  border: 1px solid #2b5a48;
  border-radius: 8px;
  padding: 4px 10px;
  white-space: nowrap;
}
.stock b {
  color: #e3b341;
}

.felt {
  background: radial-gradient(ellipse at 50% 30%, #155a42, #0e3d2e);
  border: 1px solid #1e4d3d;
  border-radius: 10px;
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-height: 150px;
}
.trick {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  min-height: 56px;
  align-items: center;
}
.slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 40px;
}
.slot .tag {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.6;
}
.callout {
  min-height: 18px;
  font-size: 13px;
  font-weight: 600;
  color: #e3b341;
  text-align: center;
}
.msg {
  font-size: 13px;
  text-align: center;
  opacity: 0.92;
  min-height: 18px;
}
.msg.warn {
  color: #ff9d6b;
}

/* cards */
.card,
.mini {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #fdfaf3;
  color: #1c1b18;
  line-height: 1;
}
.card {
  width: 54px;
  height: 78px;
  border: 1px solid #cfc7b4;
  border-bottom-width: 3px;
  font-size: 19px;
  gap: 2px;
  cursor: pointer;
  padding: 0;
  position: relative;
}
.card .s {
  font-size: 21px;
}
.card.red {
  color: #b03030;
}
.card.trump-card {
  box-shadow: 0 0 0 2px #e3b341 inset;
}
.card.dim {
  opacity: 0.35;
  cursor: default;
}
.card.playable {
  outline: 2px solid #7de08a;
  outline-offset: 1px;
}
.mini {
  width: 44px;
  height: 56px;
  font-size: 16px;
  border: 1px solid #cfc7b4;
}
.mini .s {
  font-size: 18px;
}
.mini.red {
  color: #b03030;
}
.mini.winning {
  outline: 2px solid #e3b341;
}

/* hand + controls */
.hand-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hand {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  min-height: 88px;
  padding: 6px 2px 2px;
}
.controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

/* overlays */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 14, 10, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 30;
}
.panel {
  background: #10362a;
  border: 1px solid #2b5a48;
  border-radius: 12px;
  padding: 18px;
  max-width: 460px;
  width: 100%;
  max-height: 86vh;
  overflow: auto;
}
.panel h2 {
  margin: 0 0 10px;
  font-size: 18px;
}
#overlay-body {
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.show-entry {
  background: #0b2018;
  border: 1px solid #1e4d3d;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}
.show-entry b {
  display: block;
  margin-bottom: 2px;
}
.show-entry .items {
  opacity: 0.85;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.show-entry .items span {
  background: #10362a;
  border-radius: 5px;
  padding: 1px 6px;
}
.show-entry .pts {
  color: #e3b341;
  font-weight: 700;
  float: right;
}
.show-entry .setline {
  color: #ff9d6b;
  font-weight: 600;
}
.rules-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  line-height: 1.45;
}
.panel .btn {
  margin-top: 10px;
  width: 100%;
}

@media (max-width: 420px) {
  .card {
    width: 44px;
    height: 66px;
    font-size: 15px;
  }
  .card .s {
    font-size: 17px;
  }
  .mini {
    width: 36px;
    height: 46px;
    font-size: 13px;
  }
  .meta {
    font-size: 11px;
  }
  .opp-cards {
    max-width: 200px;
  }
  .stock {
    margin-left: 0;
  }
}


/* canasta table extras */
.actionbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.actionbar .btn {
  flex: 1 1 auto;
  min-height: 44px;
}
.center-row {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
}
.stock,
.pile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.stock b {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 60px;
  border-radius: 8px;
  background: #1d4636;
  border: 1px solid #2f6a54;
  font-size: 18px;
}
.stock span,
.pile span {
  font-size: 11px;
  opacity: 0.7;
}
.pile-cards {
  display: flex;
  min-height: 60px;
}
.pile-cards .mini {
  margin-left: -18px;
}
.meldrow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 30px;
  align-items: flex-start;
}
.meld {
  background: #0f2f24;
  border: 1px solid #23523f;
  border-radius: 8px;
  padding: 4px 6px;
  max-width: 100%;
  overflow-x: auto;
}
.meld.canasta {
  border-color: #d4a72c;
  box-shadow: 0 0 0 1px rgba(212, 167, 44, 0.35);
}
.meld-label {
  display: block;
  font-size: 11px;
  opacity: 0.85;
  margin-bottom: 3px;
  white-space: nowrap;
}
.meld-cards {
  display: flex;
}
.meld-cards .mini {
  margin-right: -14px;
}
.meld-cards .mini:last-child {
  margin-right: 0;
}
.nomeld {
  font-size: 12px;
  opacity: 0.5;
}
.msg.error {
  color: #ff9a8d;
}
.card.sel {
  outline: 3px solid #ffd166;
  outline-offset: -3px;
  transform: translateY(-6px);
}
.who-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.who.me {
  font-size: 13px;
  opacity: 0.9;
}
.count {
  font-size: 12px;
  opacity: 0.75;
}
