/* Elfenbein Casino: light beige page, green felt tables, a serif for headings */

:root {
    --bg: #f3ecdc;
    --panel: #fbf7ee;
    --rule: #e2d7bf;
    --ink: #2a2520;
    --muted: #6f6659;
    --accent: #1f5f3f;
    --accent-dark: #164a31;
    --gold: #b8893a;
    --felt: #1c5e3c;
    --felt-dark: #154a2f;
    --red: #b3261e;
    --pos: #1d7a3e;
    --neg: #b3261e;
    --serif: Georgia, "Times New Roman", serif;
    --sans: "Segoe UI", Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1rem;
    line-height: 1.5;
}

a {
    color: var(--accent);
}

a:hover {
    color: var(--accent-dark);
}

h1, h2, h3 {
    font-family: var(--serif);
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 0.6rem;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.4rem;
}

h3 {
    font-size: 1.15rem;
    margin-top: 1.5rem;
}

/* header */

.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.5rem;
    padding: 0.9rem 1.5rem;
    background: var(--panel);
    border-bottom: 3px solid var(--gold);
}

.brand {
    font-family: var(--serif);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--gold);
    text-decoration: none;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.main-nav a {
    padding: 0.35rem 0.7rem;
    border-radius: 4px;
    text-decoration: none;
    color: var(--ink);
}

.main-nav a:hover {
    background: var(--rule);
}

.main-nav a.current {
    background: var(--accent);
    color: #fff;
}

.account {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.account form {
    display: inline;
}

.chips {
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
}

.whoami {
    color: var(--muted);
}

main {
    max-width: 68rem;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.site-footer {
    text-align: center;
    color: var(--muted);
    font-size: 0.875rem;
    padding: 1rem;
    border-top: 1px solid var(--rule);
}

/* panels and messages */

.panel {
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin: 0 0 1.5rem;
}

.panel.narrow {
    max-width: 30rem;
    margin: 2rem auto;
}

.lead {
    font-size: 1.1rem;
}

.hint {
    color: var(--muted);
    font-size: 0.9rem;
}

.rules-line {
    color: var(--muted);
    margin-top: -0.25rem;
}

.flash,
.error {
    padding: 0.6rem 0.9rem;
    border-left: 4px solid var(--accent);
    background: #e4efe7;
    margin: 0 0 1.25rem;
}

.error {
    border-left-color: var(--red);
    background: #f7e3e0;
}

.pos {
    color: var(--pos);
}

.neg {
    color: var(--neg);
}

.exp {
    color: var(--muted);
    font-style: italic;
}

/* buttons and forms */

button,
.button {
    display: inline-block;
    padding: 0.5rem 1.1rem;
    border: 0;
    border-radius: 5px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.button:hover {
    background: var(--accent-dark);
    color: #fff;
}

button:disabled {
    background: #a9a39a;
    cursor: default;
}

.button.secondary {
    background: #7a6f5e;
}

.button.secondary:hover {
    background: #5e5548;
}

.button.small {
    padding: 0.3rem 0.7rem;
    font-size: 0.85rem;
}

.button.big {
    padding: 0.7rem 1.6rem;
    font-size: 1.1rem;
}

.stack label,
.bets label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.stack input,
.bets input[type="number"],
.bets input[type="text"],
.bets input[type="password"],
.bets select {
    width: 100%;
    max-width: 12rem;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--rule);
    border-radius: 4px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

.bets {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem 2rem;
}

.bets p {
    margin: 0;
}

/* lobby */

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.game-card {
    display: block;
    padding: 1.25rem 1.5rem;
    background: var(--felt);
    color: #fff;
    border-radius: 10px;
    text-decoration: none;
    box-shadow: inset 0 0 0 6px var(--felt-dark);
}

.game-card:hover {
    background: var(--felt-dark);
    color: #fff;
}

.game-card h2 {
    color: #f6e7b4;
}

.game-card .meta {
    color: #d8e8dc;
    font-size: 0.9rem;
    margin-bottom: 0;
}

.game-card.soon {
    background: #6f6659;
    box-shadow: inset 0 0 0 6px #5a5247;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 0.75rem 1.5rem;
    margin-bottom: 1rem;
}

.stat-grid .big {
    display: block;
    font-family: var(--serif);
    font-size: 1.8rem;
}

/* the felt */

.table.felt {
    background: var(--felt);
    color: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 0 0 8px var(--felt-dark), 0 4px 10px rgba(0, 0, 0, 0.2);
}

.table.felt h2 {
    color: #f6e7b4;
    font-size: 1.1rem;
}

.seat,
.board-area {
    margin-bottom: 1rem;
}

.player-seats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.player-seat.active {
    outline: 3px solid #f6e7b4;
    outline-offset: 6px;
    border-radius: 6px;
}

.seat-block {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
}

.seats-5 {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.6rem;
}

.seats-5 .seat-block {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.4rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
}

.seats-5 .seat-title {
    margin: 0;
    font-size: 0.95rem;
    color: #f6e7b4;
}

.seats-5 .player-seat h3 {
    font-size: 0.9rem;
}

.seats-5 .card {
    width: 2.6rem;
    height: 3.7rem;
    font-size: 0.85rem;
    padding: 0.15rem 0.25rem;
}

.seats-5 .cards {
    gap: 0.25rem;
    min-height: 3.7rem;
}

.seats-5 .player-seat.active {
    outline-offset: 3px;
}

@media (max-width: 900px) {
    .seats-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.total {
    font-weight: 400;
    color: #d8e8dc;
}

.cards {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    min-height: 5rem;
}

.card {
    width: 3.6rem;
    height: 5rem;
    border-radius: 6px;
    background: #fff;
    color: #111;
    border: 1px solid #999;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.25rem 0.35rem;
    font-weight: 700;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
}

.card {
    position: relative;
}

.card.used-player {
    outline: 3px solid #3ddc84;
    outline-offset: 1px;
}

.card.used-dealer {
    outline: 3px solid #e74c3c;
    outline-offset: 1px;
}

.card.star-below::before,
.card.star-above::before {
    content: "\2605";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: #f1c40f;
    font-size: 1.2rem;
    line-height: 1;
    text-shadow: 0 0 2px #000;
}

.card.star-below::before {
    bottom: -1.4rem;
}

.card.star-above::before {
    top: -1.4rem;
}

.cards.marked {
    padding: 1.3rem 0;
}

.card .rank {
    font-size: 1.15rem;
    line-height: 1;
}

.card .suit {
    font-size: 1.6rem;
    line-height: 1;
    align-self: flex-end;
}

.card.red {
    color: var(--red);
}

.card.back {
    background: repeating-linear-gradient(45deg, #8b1e2d, #8b1e2d 6px, #a8303f 6px, #a8303f 12px);
    border-color: #fff;
}

.outcome {
    margin: 0.4rem 0 0;
    font-weight: 700;
    color: #f6e7b4;
}

.player-seat.lose .outcome {
    color: #f3b8b0;
}

.message {
    min-height: 1.5rem;
    margin: 0.5rem 0;
    font-weight: 600;
}

.message.error-text {
    color: #f3b8b0;
}

.pot {
    margin: 0.5rem 0 0;
    color: #d8e8dc;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.actions .button {
    background: #f6e7b4;
    color: var(--ink);
}

.actions .button:hover {
    background: #ffd977;
    color: var(--ink);
}

.actions .button.secondary {
    background: #d8e8dc;
}

#round-summary {
    padding-left: 1.2rem;
}

/* tables of data */

table.data {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 0.95rem;
}

table.data th,
table.data td {
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--rule);
    text-align: left;
    vertical-align: top;
}

table.data thead th {
    background: #efe6d3;
}

table.data.compact td,
table.data.compact th {
    padding: 0.3rem 0.5rem;
}

table.history .hand {
    display: block;
    white-space: nowrap;
}

table.history em {
    color: var(--muted);
}

table.situations {
    font-size: 0.85rem;
}

table.chart td {
    text-align: center;
    font-weight: 700;
    width: 2.8rem;
}

table.chart.ev td {
    font-weight: 400;
}

.act-S {
    background: #f3c969;
}

.act-H {
    background: #f1f1f1;
}

.act-D {
    background: #8fcf9f;
}

.act-P {
    background: #9ec5f0;
}

span.act-S,
span.act-H,
span.act-D,
span.act-P {
    padding: 0 0.4rem;
    font-weight: 700;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tabs a {
    padding: 0.35rem 0.8rem;
    border: 1px solid var(--rule);
    border-radius: 999px;
    background: var(--panel);
    text-decoration: none;
    color: var(--ink);
}

.tabs a.current {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.pager a {
    margin-right: 1rem;
}

.ranking li {
    margin-bottom: 0.3rem;
}

@media (max-width: 40rem) {
    .site-header {
        padding: 0.75rem 1rem;
    }

    .account {
        margin-left: 0;
    }

    main {
        padding: 1rem 0.75rem 2rem;
    }

    .card {
        width: 3rem;
        height: 4.2rem;
    }
}

.modes {
    flex-basis: 100%;
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    margin: 0 0 0.5rem;
}

.modes legend {
    font-weight: 600;
    padding: 0 0.3rem;
}

.modes label,
.check label {
    display: block;
    font-weight: 400;
    margin: 0.2rem 0;
}

.modes input,
.check input {
    width: 1rem;
    height: 1rem;
    margin: 0 0.4rem 0 0;
    vertical-align: -0.1rem;
    accent-color: var(--accent);
}

.shoe-note {
    font-weight: 400;
    font-size: 0.85rem;
    color: #d8e8dc;
}

table.chart td.differs {
    outline: 2px solid var(--ink);
    outline-offset: -2px;
}

.tables {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr;
}

.tables.cols-2,
.tables.cols-3 {
    grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
}

.bj-table .bets {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.bj-table .bets label {
    color: #fff;
}

.bj-table .bets input[type="number"] {
    max-width: 6rem;
    margin-left: 0.4rem;
}

.bj-table h3 {
    margin-top: 0.4rem;
    font-size: 1rem;
    color: #f6e7b4;
}

.table-title {
    font-size: 1.2rem;
}

.card.clickable {
    cursor: pointer;
}

.card.selected {
    outline: 3px solid #f6e7b4;
    outline-offset: 2px;
    transform: translateY(-6px);
}

.hint.light {
    color: #d8e8dc;
}

.chart {
    width: 100%;
    max-width: 40rem;
    height: auto;
    background: #fff;
    border: 1px solid var(--rule);
    border-radius: 6px;
    margin-bottom: 1rem;
}

.chart polyline {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
}

.chart .zero {
    stroke: var(--rule);
    stroke-width: 1;
}

.chart text {
    font-size: 12px;
    fill: var(--muted);
}

.sim-form fieldset {
    flex-basis: auto;
    min-width: 18rem;
}

.room-controls .bets {
    align-items: center;
}

code {
    background: #efe6d3;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

.card.held {
    outline: 3px solid #f6e7b4;
    outline-offset: 2px;
}

.paytable {
    margin-top: 1rem;
}

.paytable td,
.paytable th {
    text-align: center;
}

.played th,
.played td {
    text-align: center;
    min-width: 2.2rem;
}

.chart {
    position: relative;
    margin: 0.5rem 0 1.2rem;
}

.curve-svg {
    width: 100%;
    height: auto;
    display: block;
    background: #fffdf8;
    border: 1px solid var(--rule);
    border-radius: 6px;
}

.curve-svg .grid {
    stroke: #e3dccd;
    stroke-width: 1;
}

.curve-svg .grid.light {
    stroke: #efe9dc;
}

.curve-svg .grid.zero {
    stroke: #8a8070;
    stroke-width: 1.5;
}

.curve-svg .tick {
    font-size: 12px;
    fill: #6b6456;
}

.curve-svg .axis-label {
    font-size: 12px;
    fill: #6b6456;
    font-style: italic;
}

.curve-svg .curve-line {
    fill: none;
    stroke: #2b3a2f;
    stroke-width: 2;
    stroke-linejoin: round;
}

.curve-svg .dot.pos {
    fill: #2e7d4f;
}

.curve-svg .dot.neg {
    fill: #b3261e;
}

.curve-svg .cross {
    stroke: #b08d3c;
    stroke-width: 1;
    stroke-dasharray: 4 3;
}

.curve-svg .mark {
    fill: #fff;
    stroke: #b08d3c;
    stroke-width: 2;
}

.chart-tip {
    position: absolute;
    top: 0.4rem;
    padding: 0.3rem 0.6rem;
    background: #2b3a2f;
    color: #fff;
    border-radius: 4px;
    font-size: 0.85rem;
    pointer-events: none;
    white-space: nowrap;
}

.chart-filter label {
    margin-right: 1rem;
}

.chart-filter input {
    margin-right: 0.3rem;
    accent-color: var(--accent);
}
