:root {
    --felt: #0a5c36;
    --accent: #d4af37;
    --card: #fff;
    --muted: #cfd8cf;
    --glass: rgba(255, 255, 255, 0.06);
    --special_background: radial-gradient(circle at 10% 20%, rgba(0, 0, 0, 0.25), transparent 20%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.25), transparent 40%),
        var(--felt);
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    overflow: hidden;
    box-sizing: border-box;
}

body {
    
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.container {
    width: 100%;
    height: 100%;
    max-width: none;
    display: flex;
    gap: 28px;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    overflow: hidden;
    padding: 14px;
    background-color: rgba(40,40,40,0.9)

}

.table {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.06)),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 18px);
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.02);
    position: relative;
    overflow: auto;
    width: 90%;
    height: 90%;
    box-sizing: border-box;
    max-width: 900px;
    max-height: 600px;
}

h1 {
    margin: 0 0 12px 0;
    color: var(--card);
    font-size: 28px;
    letter-spacing: 0.6px;
}

p.lead {
    margin: 0 0 22px 0;
    color: rgba(255, 255, 255, 0.85);
}

.lobby {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
    
}

.join {
    background: var(--glass);
    border-radius: 10px;
    padding: 18px;
    width: 320px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--muted);
}

input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: none;
    outline: none;
    font-size: 15px;
    box-sizing: border-box;
    margin-bottom: 12px;
}

.controls {
    display: flex;
    gap: 10px;
}

button.primary {
    flex: 1;
    background: linear-gradient(180deg, var(--accent), #b88725);
    color: #111;
    font-weight: 700;
    padding: 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    transition: transform .12s ease;
}

button.ghost {
    flex: 1;
    background: transparent;
    color: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
}

button.primary:active {
    transform: translateY(1px) scale(.998);
}

.status {
    margin-top: 14px;
    font-size: 13px;
    color: #f5f5f2;
}

.players {
    margin-top: 18px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.02));
    padding: 12px;
    border-radius: 8px;
    max-height: 300px;
    overflow: auto;
    border: 1px solid rgba(0, 0, 0, 0.25);
    min-width: 360px;
}

.player {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03), transparent);
    color: var(--card);
    font-weight: 600;
}

.panel {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.02));
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

small.hint {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 6px;
    font-size: 12px;
}

footer {
    margin-top: 18px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 13px;
    text-align: center;
}

/* hide helper */
.hidden { display: none !important; }

/* center the game screen container */
#gameScreen {
  width: 100%;
  height: 100%;
  background: black;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
}

/* blackjack table visual (green felt) */
.blackjack-table {
  width: 95vw;
  height: 95vh;

  background-color: var(--felt);
  border: 30px solid #3d2b1f;
  border-radius: 20px 20px 250px 250px; /* Creates the semi-oval shape */
  padding: 40px;
  box-shadow: inset 0 0 100px rgba(0,0,0,0.5), 0 20px 50px rgba(0,0,0,0.5);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 60px;
  align-items: center;
  box-sizing: border-box;
  position: relative;
}

/* top row layout */
.section {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.section.dealer-side {
  order: 1;
}

.section.player-side {
  order: 3;
}

.table-center {
  order: 2;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  padding: 20px 40px;
  margin: 10px auto;
}

.label {
  font-weight: bold;
  letter-spacing: 3px;
  opacity: 0.7;
  color: #fff;
  margin: 10px 0 0 0;
}

.section.dealer-side .label {
  order: 2;
}

.section.dealer-side .card-slot {
  order: 1;
}

.section.player-side .label {
  order: 1;
}

.section.player-side .card-slot {
  order: 2;
}

/* card slot styling */
.card-slot {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin: 10px;
  min-height: 100px;
}

/* dealer area */
.dealer-area { display:flex; flex-direction:column; align-items:flex-start; }
.dealer-area .label { font-weight:700; margin-bottom:8px; color:#fff; }
.hand { display:flex; gap:10px; align-items:center; }

/* card visuals */
.card {
  width: 60px;
  height: 85px;
  background: white;
  border-radius: 5px;
  color: black;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: 1.2rem;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.card.back {
  background: #b22222;
  border: 2px solid white;
  color: white;
}

/* player panels */
.players-grid {
  width: 100%;
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  justify-content:center;
}
.players-grid .game-player {
  color: white;
  border-radius:8px;
  padding:8px;
  min-width:200px;
  box-sizing:border-box;
}

/* small decorative chip center */
.table-chip {
  background: #fff;
  color: #0b6b3a;
  padding:6px 10px;
  border-radius:6px;
  font-weight:800;
  margin-bottom:6px;
}

/* turn indicator styling */
.turn-indicator {
  font-weight: bold;
  font-size: 1.2rem;
  color: #ffd700;
  margin: 0;
}

/* controls area */
.controls-area {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* controls */
.controls { display:flex; gap:8px; margin-top:8px; }
.btn { padding:8px 12px; border-radius:6px; border:1px solid #bbb; background:#fff; cursor:pointer; font-weight: bold; }
.btn.primary { background:#0a5c36; color:#fff; border-color: #ffd700; border: 2px solid #ffd700; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost { background:transparent; border-color:#bbb; }

/* responsive scaling so the game fills available area */
.container .table {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (max-width:760px) {
    .players-grid {
        flex-direction: column;
    }

    .card {
        width: 56px;
        height: 80px;
    }
}

@media (max-width:820px) {
    .table {
        padding: 18px;
    }

    .lobby {
        flex-direction: column;
    }

    .players {
        min-width: unset;
        width: 100%;
    }

    .join {
        width: 100%;
    }
}

@media (max-width:700px) {
  .blackjack-table { padding:12px; }
  .card { width:48px; height:70px; }
  .players-grid .game-player { min-width:150px; flex-basis: 100%; }
}

#lobbyTable {
  background: var(--special_background);
}