:root {
	--bg: #0b100d;
	--surface: #121a16;
	--surface-2: #17221c;
	--surface-3: #1c2922;
	--felt: #183d2c;
	--felt-deep: #102d20;
	--border: rgba(255,255,255,.10);
	--border-strong: rgba(255,255,255,.16);
	--text: #f5f1e8;
	--muted: #a9b2ab;
	--gold: #d7ad62;
	--gold-soft: #f0d7a3;
	--team-1: #335f91;
	--team-1-deep: #203f64;
	--team-2: #397352;
	--team-2-deep: #245039;
	--danger: #9e4d47;
	--radius: 14px;
	--shadow: 0 18px 50px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body.body-dark {
	margin: 0;
	min-height: 100vh;
	background:
		radial-gradient(circle at 50% 10%, rgba(50,102,73,.14), transparent 38rem),
		linear-gradient(180deg, #101713 0%, var(--bg) 72%);
	color: var(--text);
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(11,16,13,.88);
	backdrop-filter: blur(16px);
	border-bottom: 1px solid var(--border);
}
.site-header__inner {
	width: min(1500px, calc(100% - 32px));
	height: 68px;
	margin: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.brand { display:flex; align-items:center; gap:10px; color:var(--text); text-decoration:none; }
.brand:hover { color:var(--text); }
.brand__mark { display:grid; place-items:center; width:34px; height:34px; border-radius:10px; background:var(--gold); color:#17140e; font-size:20px; box-shadow:0 5px 20px rgba(215,173,98,.18); }
.brand__wordmark { font-weight:750; letter-spacing:-.03em; font-size:21px; }
.brand__badge { padding:4px 7px; border:1px solid rgba(215,173,98,.35); border-radius:6px; color:var(--gold-soft); font-size:9px; font-weight:800; letter-spacing:.13em; }
.site-header__meta { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:13px; }
.status-dot { width:7px; height:7px; border-radius:50%; background:#6bc58a; box-shadow:0 0 0 4px rgba(107,197,138,.10); }

.game-shell { width:min(1500px, calc(100% - 32px)); margin:0 auto; padding:24px 0 48px; }
#pepper-app > div > .row:first-child { align-items:stretch; margin:0 0 18px; gap:18px; }
#pepper-app > div > .row:first-child > .col-md-6 { flex:1 1 0; width:auto; padding:0; }
#pepper-app > div > .row:first-child > .col-md-6:first-child { display:flex; align-items:center; min-height:116px; padding:20px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); }
#pepper-app > div > .row:first-child > .col-md-6:first-child > .row { width:100%; margin:0; }
#pepper-app > div > .row:first-child > .col-md-6:first-child .col-md-6 { width:100%; padding:0; display:flex; flex-wrap:wrap; gap:10px; }

.btn { border-radius:9px; font-weight:700; border-width:1px; transition:transform .15s ease, filter .15s ease, background .15s ease; }
.btn:hover { transform:translateY(-1px); filter:brightness(1.08); }
.btn-primary { background:#345f8d; border-color:#4777a9; }
.btn-success { background:#326a4b; border-color:#46815f; }
.btn-danger { background:var(--danger); border-color:#b76760; }
.btn-warning { background:var(--gold); border-color:#e2bf80; color:#18140d; }
.btn-secondary { background:#26322c; border-color:#3b4941; color:#e7ebe8; }
.btn-light { background:#d9dedb; }
.btn-outline-primary { color:#a8c6e8; border-color:#416b94; }
.btn-outline-primary:hover { background:#345f8d; border-color:#4777a9; }

/* Scoreboard */
#pepper-app > div > .row:first-child > .col-md-6:last-child > .row { height:100%; margin:0; gap:12px; }
.team-1-bg, .team-2-bg {
	position:relative;
	min-height:116px;
	padding:18px 20px !important;
	border:1px solid var(--border-strong);
	border-radius:var(--radius);
	overflow:hidden;
	box-shadow:var(--shadow);
}
.team-1-bg { background:linear-gradient(145deg, var(--team-1), var(--team-1-deep)); }
.team-2-bg { background:linear-gradient(145deg, var(--team-2), var(--team-2-deep)); }
.team-1-bg:after, .team-2-bg:after { content:""; position:absolute; inset:0; background:linear-gradient(120deg, rgba(255,255,255,.07), transparent 45%); pointer-events:none; }
.team-1-bg h3, .team-2-bg h3 { font-size:18px; line-height:1.55; font-weight:650; letter-spacing:-.02em; }
.team-1-bg h4, .team-2-bg h4 { margin:0; font-size:14px; text-transform:uppercase; letter-spacing:.08em; font-weight:800; opacity:.82; }

/* Main table row */
#pepper-app > div > .row.mb-4.g-0 {
	margin:0 0 18px !important;
	padding:18px;
	gap:18px;
	align-items:stretch;
	background:linear-gradient(145deg, rgba(28,76,53,.97), rgba(15,45,31,.98));
	border:1px solid rgba(116,167,134,.18);
	border-radius:18px;
	box-shadow:0 24px 70px rgba(0,0,0,.34), inset 0 0 80px rgba(0,0,0,.15);
}
#pepper-app > div > .row.mb-4.g-0 > .col-md-5 { flex:1 1 42%; width:auto; }
#pepper-app > div > .row.mb-4.g-0 > .col-md-2 { flex:0 1 150px; width:auto; display:grid; place-items:center; }
#pepper-app > div > .row.mb-4.g-0 > .col-md-5:last-child { flex:1 1 34%; width:auto; }

.pepper-hand-wrapper {
	position:relative;
	width:100%;
	min-height:350px;
	background:rgba(13,25,19,.46);
	border:1px solid rgba(255,255,255,.12);
	border-radius:14px;
	box-shadow:inset 0 1px rgba(255,255,255,.04);
	overflow:visible;
}
.pepper-hand-wrapper.opposing-partners { background:rgba(13,25,19,.46); border-color:rgba(255,255,255,.12); }
.player-name { position:absolute; top:12px; left:14px; z-index:20; padding:6px 11px; border:1px solid rgba(255,255,255,.14) !important; border-radius:8px !important; color:#fff; background:rgba(9,15,12,.72) !important; backdrop-filter:blur(8px); font-size:12px; font-weight:800; letter-spacing:.04em; }
.hand_1 .player-name, .hand_3 .player-name, .hand_2 .player-name, .hand_4 .player-name { background:rgba(9,15,12,.72) !important; border:1px solid rgba(255,255,255,.14) !important; }

.pepper-hand { position:relative; margin:auto; margin-top:0; padding-top:72px; min-height:285px; display:grid; align-items:end; justify-items:center; }
.pepper-hand img { z-index:1; width:30%; grid-area:1 / 1; filter:drop-shadow(0 12px 9px rgba(0,0,0,.26)); transform-origin:50% 95%; transition:transform .18s ease, filter .18s ease; cursor:pointer; }
.pepper-hand img:hover:not(.card-place-holder) { filter:drop-shadow(0 16px 11px rgba(0,0,0,.36)) brightness(1.04); }
.card-place-holder { opacity:0; pointer-events:none; margin:0; padding:0; transform:none; }
.card-1 { margin:0 0 8px -145px; padding:0; transform:rotate(-15deg); }
.card-2 { margin:0 0 25px -90px; padding:0; transform:rotate(-9deg); }
.card-3 { margin:0 0 34px -32px; padding:0; transform:rotate(-3deg); }
.card-4 { margin:0 0 34px 32px; padding:0; transform:rotate(3deg); }
.card-5 { margin:0 0 25px 90px; padding:0; transform:rotate(9deg); }
.card-6 { margin:0 0 8px 145px; padding:0; transform:rotate(15deg); }
.card-1:hover { transform:rotate(-15deg) translateY(-8px); }
.card-2:hover { transform:rotate(-9deg) translateY(-8px); }
.card-3:hover { transform:rotate(-3deg) translateY(-8px); }
.card-4:hover { transform:rotate(3deg) translateY(-8px); }
.card-5:hover { transform:rotate(9deg) translateY(-8px); }
.card-6:hover { transform:rotate(15deg) translateY(-8px); }
.card-in-transition { filter:brightness(55%) drop-shadow(0 12px 9px rgba(0,0,0,.26)) !important; }
.sorting-cards { background:rgba(9,18,13,.74); }

/* Bid and hand actions */
.pepper-hand-wrapper .row { --bs-gutter-x: 0; }
.pepper-hand-wrapper .btn-group { gap:5px; flex-wrap:wrap; }
.pepper-hand-wrapper .btn-group > .btn { border-radius:8px !important; margin:0 !important; min-width:42px; }
.pepper-hand-wrapper .col-md-8 > .btn-group { padding:14px; }
.pepper-hand-wrapper .col-md-4.text-end { padding:14px; }
.suit-picker { position:absolute !important; z-index:30; right:14px; top:58px; }
.suit-picker .btn-group-vertical { gap:4px; padding:6px; background:rgba(10,16,13,.85); border:1px solid var(--border); border-radius:11px; backdrop-filter:blur(12px); }
.suit-picker .btn { font-size:11px; padding:5px 9px; }

/* Trick pile */
.play-cards-stack { width:100%; margin:0; }
.play-cards-stack > div { min-height:220px; display:grid; place-items:center; }
img.laydown-pile, img.deck { border:0; width:76px; border-radius:6px; filter:drop-shadow(0 12px 8px rgba(0,0,0,.3)); }
img.laydown-pile:nth-child(1) { width:100px; }

/* Chat */
#pepper-app .card { height:100%; min-height:350px; background:rgba(11,20,15,.78); border:1px solid rgba(255,255,255,.12); border-radius:14px; color:var(--text); overflow:hidden; }
#chat_output { min-height:285px; max-height:390px; padding:18px; }
.chat-line { margin-bottom:14px; padding:10px 12px; border-radius:10px; background:rgba(255,255,255,.045); color:#e8ece9; font-size:14px; }
.chat-line-username { margin-top:5px; color:#8fb7df; line-height:1; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; }
.card-footer { padding:12px; background:rgba(5,10,7,.35); border-top:1px solid var(--border); }
.form-control { background:#0f1713; border-color:#344139; color:var(--text); border-radius:9px; }
.form-control:focus { background:#111c16; color:var(--text); border-color:#718e7b; box-shadow:0 0 0 3px rgba(113,142,123,.12); }
.form-control::placeholder { color:#78837c; }

/* Other players */
#pepper-app > div > .row.g-0:last-child { gap:14px; margin:0; }
#pepper-app > div > .row.g-0:last-child > .col-md-4 { flex:1 1 30%; width:auto; }
#pepper-app > div > .row.g-0:last-child .pepper-hand-wrapper { min-height:260px; background:var(--surface); box-shadow:var(--shadow); }
#pepper-app > div > .row.g-0:last-child .pepper-hand { min-height:220px; transform:scale(.88); transform-origin:center bottom; }

.invisible { visibility:hidden; }
.alert { border-radius:10px; }
.modal-content { background:#18221d; color:var(--text); border:1px solid var(--border); }
.modal-header, .modal-footer { border-color:var(--border); }

@media (max-width: 900px) {
	.site-header__inner, .game-shell { width:min(100% - 20px, 760px); }
	.site-header__meta { display:none; }
	#pepper-app > div > .row:first-child { flex-direction:column; }
	#pepper-app > div > .row.mb-4.g-0 { flex-direction:column; padding:12px; }
	#pepper-app > div > .row.mb-4.g-0 > .col-md-5,
	#pepper-app > div > .row.mb-4.g-0 > .col-md-2 { width:100%; flex:auto; }
	#pepper-app > div > .row.mb-4.g-0 > .col-md-2 { min-height:120px; }
	.pepper-hand-wrapper { min-height:320px; }
	#pepper-app > div > .row.g-0:last-child { flex-direction:column; }
	#pepper-app > div > .row.g-0:last-child > .col-md-4 { width:100%; }
}

@media (max-width: 575px) {
	.brand__wordmark { font-size:18px; }
	.game-shell { padding-top:12px; }
	.team-1-bg, .team-2-bg { min-width:calc(50% - 6px); }
	.pepper-hand-wrapper .col-md-8 > .btn-group { padding:10px; }
	.pepper-hand img { width:35%; }
	.card-1 { margin-left:-115px; }
	.card-2 { margin-left:-72px; }
	.card-3 { margin-left:-25px; }
	.card-4 { margin-left:25px; }
	.card-5 { margin-left:72px; }
	.card-6 { margin-left:115px; }
}
