:root {
  --felt: #0b5c34;
  --felt-dark: #084027;
  --gold: #d4af37;
  --panel: #ffffffee;
  --text: #1a1a1a;
  --red: #c62828;
  --black: #1a1a1a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  background: radial-gradient(ellipse at center, var(--felt) 0%, var(--felt-dark) 100%);
  color: var(--text);
  min-height: 100vh;
}

.screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.hidden { display: none !important; }

.card-panel {
  background: var(--panel);
  border-radius: 16px;
  padding: 32px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  text-align: center;
}

.card-panel h1 { margin-top: 0; }

label { display: block; text-align: left; font-size: 13px; color: #555; margin: 10px 0 4px; }

input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
}

button {
  background: var(--felt);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 11px 18px;
  font-size: 15px;
  cursor: pointer;
  margin-top: 12px;
  width: 100%;
  transition: background 0.15s;
}
button:hover:not(:disabled) { background: var(--felt-dark); }
button:disabled { background: #aaa; cursor: not-allowed; }

.home-actions { margin-top: 18px; }
.or { margin: 14px 0 8px; color: #999; font-size: 13px; }
.error { color: var(--red); font-size: 14px; min-height: 18px; margin-top: 10px; }

.link-row { display: flex; gap: 8px; margin: 10px 0 20px; }
.link-row input { flex: 1; }
.link-row button { width: auto; margin: 0; }

.seats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.seat-slot {
  border: 2px dashed #ccc;
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
}
.seat-slot.filled { border-style: solid; border-color: var(--felt); background: #f0f8f4; }
.seat-slot .name { font-weight: 600; }
.seat-slot .disconnected { color: var(--red); font-size: 12px; }
.seat-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 44px; }
.btn-add-bot, .btn-remove-bot { width: auto; margin: 0; padding: 6px 10px; font-size: 12px; }
.btn-add-bot { background: #567; }
.btn-remove-bot { background: var(--red); }

/* --- Game screen --- */
#screen-game { flex-direction: column; padding: 10px; min-height: 100vh; justify-content: flex-start; }

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  padding: 6px 16px;
  font-size: 14px;
}
#score-board { display: flex; gap: 10px; flex-wrap: wrap; }
.capot-tile { background: rgba(0,0,0,0.25); padding: 6px 12px; border-radius: 8px; font-size: 12px; text-align: center; line-height: 1.4; }
.capot-tile.me { background: rgba(212,175,55,0.35); }
.capot-tile b { font-size: 15px; }
#trump-indicator { font-size: 18px; font-weight: 600; background: rgba(0,0,0,0.25); padding: 6px 12px; border-radius: 8px; }
#manche-indicator { text-align: center; color: white; font-size: 13px; opacity: 0.85; padding: 2px 0 6px; }

.table {
  position: relative;
  flex: 1;
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px auto;
  max-width: 700px;
  width: 100%;
}

.seat {
  position: absolute;
  color: white;
  text-align: center;
  font-size: 14px;
  background: rgba(0,0,0,0.25);
  padding: 8px 14px;
  border-radius: 10px;
  min-width: 90px;
}
.seat.active { box-shadow: 0 0 0 3px var(--gold); }
.seat-top { top: 0; left: 50%; transform: translateX(-50%); }
.seat-left { left: 0; top: 50%; transform: translateY(-50%); }
.seat-right { right: 0; top: 50%; transform: translateY(-50%); }

.trick-area {
  display: grid;
  grid-template-columns: repeat(2, 60px);
  grid-template-rows: repeat(2, 84px);
  gap: 6px;
  align-items: center;
  justify-items: center;
}
.trick-area .trick-card-slot { display: flex; align-items: center; justify-content: center; }

.panel {
  background: var(--panel);
  border-radius: 12px;
  padding: 16px;
  max-width: 520px;
  margin: 10px auto;
  text-align: center;
}
.panel h3 { margin-top: 0; }
.bid-suits { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.bid-suits button { width: auto; padding: 10px 16px; font-size: 18px; color: white; }
.bid-suits button.suit-H, .bid-suits button.suit-D { background: var(--red); }
.bid-suits button.suit-S, .bid-suits button.suit-C { background: #333; }
.btn-pass { background: #888 !important; width: auto; padding: 10px 16px; }
.turned-card-row { display: flex; justify-content: center; margin: 10px 0; }
.turned-card-row .playing-card { cursor: default; }
.hint { font-size: 12px; color: #777; margin: 4px 0; }
.capot-row { background: #fdeaea; font-weight: 600; }

.my-area { padding: 10px 0 24px; }
.my-info { text-align: center; color: white; font-weight: 600; margin-bottom: 8px; min-height: 36px; }
.my-tricks { font-weight: 400; font-size: 12px; opacity: 0.85; }

.hand { display: flex; justify-content: center; gap: -10px; flex-wrap: wrap; }

.playing-card {
  width: 58px;
  height: 84px;
  background: white;
  border-radius: 6px;
  border: 1px solid #999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 1px 2px 4px rgba(0,0,0,0.4);
  margin: 0 -8px;
  cursor: pointer;
  transition: transform 0.1s;
  user-select: none;
}
.playing-card.red { color: var(--red); }
.playing-card.black { color: var(--black); }
.playing-card:hover { transform: translateY(-10px); }
.playing-card.disabled { opacity: 0.4; cursor: not-allowed; }
.playing-card.disabled:hover { transform: none; }
.playing-card .rank { font-size: 18px; }
.playing-card .suit { font-size: 18px; }
.playing-card.mini { width: 44px; height: 62px; font-size: 12px; margin: 0; cursor: default; }
.playing-card.mini .rank, .playing-card.mini .suit { font-size: 13px; }

.scoring-table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.scoring-table td, .scoring-table th { padding: 6px 10px; border-bottom: 1px solid #ddd; }
