/* Bridgeroo play page - arcade bridge table. Rides on css/style.css tokens
   (--sky card-red, --lime felt-green, --magenta spade-indigo, --corn gold). */

.arena {
    max-width: 1240px;
    margin: 0 auto;
    padding: 96px 20px 48px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 22px;
    align-items: start;
}

.table-col { min-width: 0; }

.table-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--text-dim);
    padding: 6px 10px 12px;
    font-size: 0.95rem;
}
.table-bar strong { color: var(--corn); }
#vul-line { color: var(--tangerine); font-size: 0.85rem; }

/* ---- the table ---- */
.table {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1.3fr 1fr;
    grid-template-rows: auto 1.2fr auto;
    grid-template-areas:
        ".    north  ."
        "west center east"
        ".    south  .";
    gap: 8px;
    min-height: 420px;
    padding: 18px;
    border-radius: 22px;
    background:
        radial-gradient(circle at 50% 42%, #1c9e6d 0%, #128a5c 42%, #0c6b47 100%);
    box-shadow: inset 0 0 60px rgba(0,0,0,0.45), 0 18px 40px rgba(0,0,0,0.4);
    border: 3px solid #0a5238;
}
.seat { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.seat.north { grid-area: north; }
.seat.south { grid-area: south; }
.seat.west  { grid-area: west; justify-content: center; }
.seat.east  { grid-area: east; justify-content: center; }
.table-center { grid-area: center; display: flex; align-items: center; justify-content: center; }
.felt-badge {
    text-align: center; line-height: 1.05; font-size: 1.5rem;
    color: rgba(255,255,255,0.14); letter-spacing: 2px; user-select: none;
}

.seat-info {
    display: flex; align-items: center; gap: 8px;
    background: rgba(0,0,0,0.28);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 999px;
    padding: 6px 14px;
    max-width: 100%;
}
.seat-info.turn {
    border-color: var(--corn);
    box-shadow: 0 0 0 2px rgba(255,210,63,0.35), 0 0 18px rgba(255,210,63,0.3);
}
.seat-info .glyph { font-size: 1.2rem; }
.seat-info .nm { font-weight: 700; font-size: 0.92rem; white-space: nowrap; }
.seat-info .tk { font-size: 0.78rem; color: var(--lime); margin-left: 4px; white-space: nowrap; }
.seat-info .tag {
    font-size: 0.6rem; background: var(--magenta); color: #fff;
    padding: 1px 5px; border-radius: 4px; margin-left: 4px; vertical-align: middle;
}
.seat-info .tag.dm { background: var(--tangerine); color: #201400; }

.trick-slot { min-height: 74px; display: flex; align-items: center; justify-content: center; }

/* ---- cards ---- */
.card {
    width: 50px; height: 70px; border-radius: 7px;
    background: linear-gradient(160deg, #ffffff 0%, #f2f2f5 100%);
    border: 1px solid #cfd2da;
    box-shadow: 0 2px 4px rgba(0,0,0,0.28);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #1a1a22; font-weight: 700; user-select: none; flex: 0 0 auto;
}
.card .rk { font-size: 1.15rem; line-height: 1; }
.card .su { font-size: 1rem; line-height: 1.1; }
.card.red { color: #e11d48; }
.card.mini { width: 38px; height: 54px; }
.card.playable { cursor: pointer; transition: transform 0.08s ease, box-shadow 0.08s ease; }
.card.playable:hover { transform: translateY(-8px); box-shadow: 0 8px 14px rgba(0,0,0,0.4), 0 0 0 2px var(--corn); }

/* ---- hands ---- */
.hand-block { margin-top: 14px; }
.hand-label { font-weight: 700; color: var(--text-dim); margin-bottom: 6px; font-size: 0.9rem; }
.hand-label .hcp { color: var(--corn); font-weight: 600; margin-left: 6px; }
.hand-row { display: flex; flex-wrap: wrap; gap: 6px; min-height: 72px; }
.hand-block.dummy .hand-row { opacity: 0.96; }
.hand-block.dummy .card { width: 42px; height: 60px; }

/* ---- overlay ---- */
.overlay {
    position: absolute; inset: 0; border-radius: 22px;
    background: rgba(6,10,14,0.82); backdrop-filter: blur(3px);
    display: none; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; gap: 12px; padding: 24px; z-index: 5;
}
.overlay.show { display: flex; }
#overlay-title { font-family: 'Titan One','Arial Black',sans-serif; font-size: 2rem; color: var(--corn); }
#overlay-text { color: var(--text); line-height: 1.6; }
#overlay-text .score-line { font-size: 1.6rem; font-weight: 700; margin: 6px 0; }
#overlay-text .score-line.good { color: var(--lime); }
#overlay-text .score-line.bad { color: var(--sky); }
#overlay-text .sub { font-size: 0.85rem; color: var(--text-dim); }

/* Buttons ARE the craftpix 567216 blank button art, drawn as a border-image
   9-slice so the glossy body, rounded corners and baked shadow scale to any
   label. Green = deal/action, grey = ghost, red = resign. */
.btn-deal {
    position: relative;
    display: inline-block;
    min-height: 20px;
    padding: 0.2rem 0.9rem 0.35rem;
    border-style: solid;
    border-width: 18px 24px 26px 22px;
    border-image-source: url('/img/ui/btnbg-green.png');
    border-image-slice: 40 48 52 44 fill;
    border-image-repeat: stretch;
    background: transparent;
    color: #05331f;
    font-family: 'Titan One','Arial Black',sans-serif;
    font-size: 1rem; letter-spacing: 0.03em; text-align: center;
    cursor: pointer;
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
    filter: drop-shadow(0 4px 7px rgba(0,0,0,0.4));
    transition: transform 0.07s ease, filter 0.12s ease;
}
.btn-deal:hover { filter: brightness(1.07) saturate(1.06) drop-shadow(0 5px 9px rgba(0,0,0,0.45)); }
.btn-deal:active { transform: translateY(3px); filter: brightness(0.97) drop-shadow(0 2px 4px rgba(0,0,0,0.4)); }
.btn-deal.ghost {
    border-image-source: url('/img/ui/btnbg-grey.png');
    color: #241a08; width: 100%; margin-top: 4px;
}

/* ---- panel ---- */
.panel { display: flex; flex-direction: column; gap: 14px; }
.card-box {
    background: var(--card); border: 1px solid var(--card-line);
    border-radius: 14px; padding: 14px 16px;
}
.card-box h3 {
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--corn); margin-bottom: 10px; font-weight: 700;
}
#status { min-height: 1.4em; font-weight: 600; }
#status.shake { animation: shake 0.35s; color: var(--sky); }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }
.session { margin-top: 8px; font-size: 0.82rem; color: var(--text-dim); }

/* ---- auction table ---- */
.auction-wrap { max-height: 150px; overflow-y: auto; margin-bottom: 10px; }
.auction-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.ah { text-align: center; font-size: 0.85rem; padding: 3px 0; border-radius: 4px; }
.ah.head { color: var(--text-dim); font-weight: 700; font-size: 0.72rem; text-transform: uppercase; border-bottom: 1px solid var(--card-line); }
.ah.call { background: rgba(255,255,255,0.06); font-weight: 700; }
.ah.call.pass { color: var(--text-dim); font-weight: 500; }
.ah.call.dbl { color: var(--sky); }
.ah .red { color: #ff6b8a; }

/* ---- bidding box ---- */
.bidbox-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 6px; }
.bidbtn {
    padding: 6px 0; border-radius: 6px; border: 1px solid var(--card-line);
    background: rgba(255,255,255,0.08); color: var(--text); font-weight: 700;
    cursor: pointer; font-size: 0.9rem;
}
.bidbtn.red { color: #ff8098; }
.bidbtn:hover:not(:disabled) { border-color: var(--corn); background: rgba(255,210,63,0.14); }
.bidbtn:disabled { opacity: 0.24; cursor: default; }
.bidbox-row { display: flex; gap: 4px; }
.bidbtn.wide { flex: 1; }
.bidbtn.pass { color: var(--text-dim); }
.bidbtn.dbl { color: var(--sky); border-color: rgba(255,59,107,0.5); }

/* ---- lingo ---- */
.events { display: flex; flex-direction: column; gap: 7px; max-height: 260px; overflow-y: auto; }
.ev { font-size: 0.86rem; line-height: 1.4; padding: 6px 9px; border-radius: 8px; background: rgba(255,255,255,0.05); }
.ev.spicy { background: rgba(255,59,107,0.12); border-left: 2px solid var(--sky); }
.ev-who { font-weight: 700; }

/* ---- rail (realtime chat + presence) ---- */
.rail-presence { font-size: 0.8rem; color: var(--lime); font-weight: 700; margin-bottom: 4px; min-height: 1em; }
.rail-status { font-size: 0.78rem; color: var(--text-dim); margin-bottom: 6px; min-height: 1em; }
.rail-msgs { display: flex; flex-direction: column; gap: 5px; max-height: 200px; overflow-y: auto; margin-bottom: 8px; }
.rail-msg { font-size: 0.84rem; line-height: 1.35; padding: 5px 8px; border-radius: 8px; background: rgba(255,255,255,0.05); word-break: break-word; }
.rail-msg .rn { font-weight: 700; color: var(--corn); margin-right: 4px; }
.rail-msg.sys { background: none; color: var(--text-dim); font-size: 0.76rem; padding: 2px 8px; }
.rail-form { display: flex; gap: 6px; opacity: 0.55; pointer-events: none; }
.rail-form.live { opacity: 1; pointer-events: auto; }
.rail-form input {
    flex: 1; min-width: 0; padding: 7px 9px; border-radius: 7px;
    border: 1px solid var(--card-line); background: rgba(0,0,0,0.25);
    color: var(--text); font-size: 0.85rem;
}
.rail-form input:focus { outline: none; border-color: var(--lime); }
.rail-form .btn-deal { border-width: 12px 16px 18px 15px; padding: 0.1rem 0.5rem 0.2rem; font-size: 0.82rem; }

/* ---- slam league panel ---- */
.league-status { font-size: 0.86rem; color: var(--text-dim); margin-bottom: 8px; }
.league-form { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.league-form input {
    padding: 7px 9px; border-radius: 7px; border: 1px solid var(--card-line);
    background: rgba(0,0,0,0.25); color: var(--text); font-size: 0.85rem;
}
.league-form input:focus { outline: none; border-color: var(--lime); }
.league-form-row { display: flex; gap: 6px; margin-top: 2px; }
.league-form-row .btn-deal { flex: 1; border-width: 13px 16px 19px 15px; padding: 0.1rem 0.4rem 0.2rem; font-size: 0.85rem; }
.lf-msg { font-size: 0.8rem; color: var(--lime); min-height: 1em; }
.lf-msg.bad { color: var(--sky); }
.league-last { font-size: 0.82rem; color: var(--text-dim); margin-top: 8px; }
.league-last strong { color: var(--corn); }
.league-last a { color: var(--lime); }
.linklike {
    background: none; border: none; color: var(--text-dim); cursor: pointer;
    font-size: 0.78rem; text-decoration: underline; padding: 4px 0; margin-top: 4px;
}
.linklike:hover { color: var(--sky); }

@media (max-width: 920px) {
    .arena { grid-template-columns: 1fr; }
    .panel { order: 2; }
}
