/* In-game panels (Esc menu, scoreboard, results, disconnection, settings): parchment card in the same bronze / gold frame as the windows,
   a bronze title ribbon for the first heading, ink text; tables read on parchment with team-coloured headers. */
.panel { position: relative; background: linear-gradient(rgba(240, 230, 203, 0.96), rgba(217, 200, 160, 0.96)); color: var(--ink); border-radius: 8px; padding: 16px 18px;
  box-shadow: 0 0 0 2px var(--wood-dark), 0 0 0 4px #8a5a28, 0 0 0 5px var(--gold), 0 0 0 7px var(--wood-dark), inset 0 0 0 1px #fff7da, inset 0 0 0 3px rgba(168, 116, 58, 0.5), 0 10px 30px rgba(0, 0, 0, 0.55); }
.panel h3 { margin: 14px 0 8px; font-size: 14px; letter-spacing: 1.5px; text-transform: uppercase; color: #7a4c22; }
.panel h3:first-child { margin: -16px -18px 12px; padding: 7px 14px; font-size: 15px; letter-spacing: 1px; color: var(--gf-title, #ffe44d); text-shadow: 0 1px 2px #3a2208; border-radius: 6px 6px 0 0;
  background: linear-gradient(#b27a3f, #7a4c22); box-shadow: inset 0 1px 0 rgba(255, 233, 160, 0.6), 0 1px 0 var(--wood-dark); }
.panel .mute { color: #7a6544; }
.panel.modal { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 30; min-width: min(320px, 92vw); max-width: 92vw; max-height: 86vh; overflow: auto; pointer-events: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin: -16px -18px 10px; padding: 5px 8px 5px 14px; border-radius: 6px 6px 0 0; background: linear-gradient(#b27a3f, #7a4c22); box-shadow: inset 0 1px 0 rgba(255, 233, 160, 0.6); }
.modal-head h3, .panel .modal-head h3:first-child { margin: 0; padding: 0; background: none; box-shadow: none; }
.modal-head .btn { padding: 1px 9px; font-size: 12px; border-radius: 6px; }
.menu { display: flex; flex-direction: column; gap: 10px; text-align: center; min-width: min(300px, 90vw); }
.menu .btn { padding: 9px 16px; font-size: 15px; }
.disc { text-align: center; }
.settings .keys { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; margin: 8px 0 12px; }
.key-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.keybtn { min-width: 70px; padding: 4px 10px; font-weight: 700; color: var(--ink); background: linear-gradient(#f4e6bf, #cdb27a); border: 2px solid #5b3a18; border-radius: 6px; }
.keybtn.wait { border-color: #c98a1c; color: #b6560a; }
.row-check { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 14px; }
.settings h4 { color: #7a4c22; margin: 14px 0 4px; }
#ui .scoreboard { pointer-events: none; position: absolute; left: 50%; top: clamp(70px, 12vh, 120px); transform: translateX(-50%); width: min(780px, 94vw); z-index: 25; }
.scoreboard .human .glyph { width: 12px; height: 12px; margin-left: 4px; vertical-align: -1px; color: #7a4c22; }
table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 10px; }
th { text-align: right; color: color-mix(in srgb, var(--tc, #7a4c22) 45%, #1e1008); font-weight: 800; padding: 3px 6px; border-bottom: 2px solid #a88a58; }
th:first-child, td.nm { text-align: left; }
td { text-align: right; padding: 3px 6px; border-bottom: 1px solid rgba(138, 102, 54, 0.3); }
tr.me td { background: rgba(241, 192, 74, 0.35); font-weight: 700; }
td.nm { color: color-mix(in srgb, var(--tc, #4a2f14) 45%, #1e1008); font-weight: 700; }
.result { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(660px, 94vw); text-align: center; z-index: 25; }
.result h2 { font-size: clamp(32px, 4vw, 52px); font-weight: 800; margin: 0 0 4px; -webkit-text-stroke: 2px #2a1708; paint-order: stroke fill; }
.result h2.win { color: var(--gold); text-shadow: 0 3px 0 #7a4c22, 0 0 24px rgba(241, 192, 74, 0.7); }
.result h2.lose { color: #ff9a94; text-shadow: 0 3px 0 #5a1216; }
.result .orn { inset: -6px; }
.settings { width: min(560px, 94vw); }
.set-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.set-tabs .btn, .set-presets .btn { flex: 1; padding: 4px 8px; }
.set-tabs .btn.on, .set-presets .btn.on { background: linear-gradient(#d5eccb, #9fd48f); border-color: #3a8a2c; }
.set-presets { display: flex; gap: 4px; align-items: center; margin-bottom: 6px; }
.set-custom { padding: 0 8px; font-size: 12px; color: #8a7a56; }
.set-custom.on { color: #b6560a; font-weight: 700; }
.set-btns { display: flex; gap: 6px; margin-bottom: 4px; }
.set-btns .btn { padding: 4px 10px; font-size: 12px; }
.set-status { margin: 2px 0 6px; }
.set-row { display: grid; grid-template-columns: 1fr 210px; align-items: center; gap: 2px 12px; margin: 4px 0; font-size: 13px; }
.set-row .set-label { color: #4a3414; }
.set-ctl select { width: 100%; }
.set-slider { display: flex; align-items: center; gap: 8px; }
.set-slider input { flex: 1; }
.set-val { width: 48px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.set-hint { grid-column: 1 / -1; margin: 0 0 2px; }
.scoreboard .mvp, .result .mvp { color: #f1c04a; font-weight: 800; margin-left: 5px; text-shadow: 0 0 6px rgba(241, 192, 74, 0.7); }
.result .arena-pts { margin: 6px 0 0; font-weight: 800; color: #f1c04a; text-align: center; }

.scoreboard tr.look { cursor: pointer; }
.scoreboard tr.look:hover td { background: rgba(255, 244, 200, 0.18); }
/* The generic confirmation window (ui/confirmDialog.js): above the game windows, a dimmed veil that cancels when clicked */
.confirm-veil { position: absolute; inset: 0; z-index: 60; background: rgba(20, 12, 4, 0.45); pointer-events: auto; display: flex; align-items: center; justify-content: center; }
.panel.confirm { width: min(300px, 92vw); max-height: 80vh; overflow: auto; padding: 10px 12px; font-size: 12px; }
.panel.confirm .modal-head { margin: -10px -12px 6px; padding: 3px 6px 3px 10px; }
.panel.confirm .modal-head h3 { font-size: 12px; }
.confirm-text { margin: 2px 0 6px; line-height: 1.35; }
.confirm-btns { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; margin-top: 8px; }
.confirm-btns .btn { padding: 3px 10px; font-size: 11.5px; min-height: 0; border-radius: 6px; }
