/* Regal theme: parchment-gold on deep midnight, serif lettering, double-ruled frames. Loaded last so it wins over style.css. */
:root {
  --serif: 'Cinzel', 'Trajan Pro', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, 'Times New Roman', serif;
  --bg: #0a0b14; --bg2: #0f1222; --card: #151a2d; --card2: #1d2440; --line: #2f3658;
  --gold: #d9a93f; --gold2: #f1d78a; --good: #7fbf8e; --bad: #d1606b; --blue: #7aa6d8;
}
* { scrollbar-width: thin; scrollbar-color: #d9a93f66 transparent; }
::selection { background: #d9a93f55; }

/* frames */
.card, .modalcard {
  border: 1px solid #d9a93f55; border-radius: 6px; background: linear-gradient(#181d33, #11152a);
  box-shadow: inset 0 0 0 3px #0c0f1c, inset 0 0 0 4px #d9a93f26, 0 8px 28px #0008;
}
h3 { display: flex; align-items: center; gap: 12px; font-family: var(--serif); font-weight: 600; letter-spacing: .2em; color: var(--gold2); }
h3::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, #d9a93f99, transparent); }

/* buttons, tabs, pills */
.btn { font-family: var(--serif); letter-spacing: .05em; border-radius: 4px; border-color: #d9a93f55; background: linear-gradient(#232b48, #171d34); }
.btn:hover:not(:disabled) { border-color: var(--gold2); box-shadow: 0 0 12px #d9a93f44; }
.btn.gold { background: linear-gradient(#f3d27f, #b98a2c); border-color: #f6e2a0; color: #241805; text-shadow: 0 1px 0 #fff5; box-shadow: inset 0 1px 0 #fff7, 0 2px 8px #0008; }
.btn.small { font-size: 11.5px; }
.btn.ghost { background: transparent; }
.tab { font-family: var(--serif); letter-spacing: .12em; text-transform: uppercase; font-size: 12px; }
.pill { font-family: var(--serif); letter-spacing: .14em; border-radius: 3px; }
.kindtag { font-family: var(--serif); letter-spacing: .12em; border-radius: 3px; }
.k-move { background: #7fbf8e; } .k-attack { background: #d1606b; } .k-defend { background: #7aa6d8; } .k-dev { background: #e0b350; } .k-draft { background: #cdbf9f; }
.order.k-move { border-left-color: #7fbf8e; } .order.k-attack { border-left-color: #d1606b; } .order.k-defend { border-left-color: #7aa6d8; } .order.k-dev { border-left-color: #e0b350; }
.order, .draft, .pl-odds, .gamecard { border-radius: 4px; }
.chip, .stat, .badge { border-radius: 4px; border-color: #d9a93f33; }

/* players, stats, bars */
.pcard { border-radius: 6px; border-color: #d9a93f33; }
.pcard.me { border-color: var(--gold); box-shadow: 0 0 12px #d9a93f33, inset 0 0 0 1px #d9a93f44; }
.kv div { border-radius: 4px; border-color: #d9a93f33; }
.kv b { font-family: var(--serif); }
.bar { border-color: #d9a93f55; height: 7px; }
.bar > i { background: linear-gradient(90deg, #8a6a24, #e8c15a); }
.mapwrap { border-color: #d9a93f55; box-shadow: inset 0 0 70px #000b; }
.gtitle, .wordmark { font-family: var(--serif); }
table.t th { font-family: var(--serif); letter-spacing: .14em; color: var(--gold); }

/* country details */
.statrow { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.statrow > span { font: 600 11.5px var(--serif); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.fine { font-size: 12px; font-style: italic; }
.rel { font: 600 11px var(--serif); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); opacity: .9; }
.cityrow { font-variant: small-caps; letter-spacing: .03em; border-left-color: #d9a93f55; }
.cityrow b { font-family: var(--serif); color: var(--gold2); font-weight: 600; }

/* hover card */
.tip { border-radius: 4px; }
.tip .infohead { align-items: center; }
.tip .infohead .ih .rel.main { font: 600 15px var(--serif); letter-spacing: .14em; text-transform: uppercase; color: var(--gold2); opacity: 1; }

/* battle bar: a gilt-framed track, a sword at each division, and a gem that ricochets before it settles */
.odds { position: relative; display: block; height: 30px; overflow: visible; margin: 22px 0 30px; border: none; border-radius: 0; }
.odds-track { display: flex; height: 100%; border-radius: 3px; overflow: hidden; border: 1px solid var(--gold); box-shadow: inset 0 0 0 2px #0b0e19, 0 0 16px #000c; }
.odds .seg {
  height: 100%; flex: none; display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap;
  background-image: linear-gradient(#ffffff38, #0000 48%, #0000005a); color: #fff2cf; text-shadow: 0 1px 2px #000;
  font: 600 11px var(--serif); letter-spacing: .1em; text-transform: uppercase;
}
.odds .sword { position: absolute; top: -13px; width: 18px; height: 56px; transform: translateX(-50%); z-index: 3; pointer-events: none; filter: drop-shadow(0 2px 3px #000c) drop-shadow(0 0 6px #e8b84a66); }
.odds .marker {
  position: absolute; left: 0; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; z-index: 4; transition: none;
  background: #fff3c4; box-shadow: 0 0 10px 2px #f1d78acc;
}
.odds .marker::before { content: ''; position: absolute; top: -7px; left: -4px; width: 10px; height: 10px; background: #f1d78a; border: 1px solid #7a5b1c; transform: rotate(45deg); }
.odds .marker::after {
  content: attr(data-v); position: absolute; top: 100%; left: -20px; width: 42px; margin-top: 10px; text-align: center; opacity: 0;
  font: 600 11px var(--serif); letter-spacing: .08em; color: var(--gold2);
}
.odds .marker.settled::after { opacity: 1; transition: opacity .3s; }

/* odds panel while planning */
.pl-odds { background: #0c1020; border-color: #d9a93f33; }
.pl-bar { background: #1b2238; }

/* cinema */
.cine-card {
  border: 1px solid var(--gold); border-radius: 6px; background: radial-gradient(120% 100% at 50% 0%, #1f2644f2, #0b0e19f2 70%);
  box-shadow: inset 0 0 0 3px #0b0e19, inset 0 0 0 4px #d9a93f66, 0 14px 50px #000d;
}
.cine-card::before, .cine-card::after { content: ''; position: absolute; top: -6px; width: 10px; height: 10px; background: var(--gold); transform: rotate(45deg); box-shadow: 0 0 8px #d9a93f99; }
.cine-card::before { left: 22px; } .cine-card::after { right: 22px; }
.kicker { display: flex; align-items: center; gap: 12px; font-family: var(--serif); }
.kicker::before, .kicker::after { content: ''; height: 1px; flex: 0 1 46px; background: linear-gradient(90deg, transparent, var(--gold)); }
.kicker::after { background: linear-gradient(90deg, var(--gold), transparent); flex: 1; }
.headline { font-family: var(--serif); background: linear-gradient(#fff6d2, #e8c15a 75%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cine-stage { border-color: #d9a93f66; border-radius: 6px; }
.stamp { border-style: double; border-width: 5px; border-radius: 4px; letter-spacing: .24em; }
.stamp.win { color: var(--good); } .stamp.lose { color: var(--bad); }
.cine-bottom .seg { height: 6px; background: #2f3658; }
.cine-bottom .seg.done { background: #8a6a24; }

/* toasts and modals */
.toast { border-radius: 4px; border-color: #d9a93f88; background: linear-gradient(#1f2644, #151a2d); box-shadow: inset 0 0 0 2px #0c0f1c, 0 8px 30px #000a; font-family: var(--serif); letter-spacing: .02em; }

/* ---- grandeur: larger type, roomier boxes, book serif for reading text ---- */
:root { --book: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, 'Times New Roman', serif; }
body { font: 16px/1.55 var(--book); }
.card { padding: 20px 24px; }
.card + .card { margin-top: 18px; }
h3 { font-size: 15px; margin-bottom: 14px; }
.btn { font-size: 14px; padding: 8px 18px; }
.btn.small { font-size: 13px; padding: 5px 13px; }
input[type=text], input[type=password], input[type=number], input[type=datetime-local], select, textarea { padding: 10px 12px; font-size: 15px; }
.chip { font-size: 14px; padding: 3px 12px; }
.pill { font-size: 12px; padding: 3px 12px; }
.tab { font-size: 13.5px; padding: 10px 18px; }
table.t { font-size: 15px; }
table.t th { font-size: 12px; }
table.t td, table.t th { padding: 8px 12px; }

/* your banner */
.banner { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.avatar.crest { width: 66px; height: 66px; font: 700 30px var(--serif); border: 3px solid var(--gold); box-shadow: 0 0 0 3px #0c0f1c, 0 0 0 4px #d9a93f66, 0 0 18px #d9a93f44; }
.banner-name { font: 700 24px var(--serif); letter-spacing: .06em; color: var(--gold2); line-height: 1.2; }
.banner-sub { font-style: italic; color: var(--muted); font-size: 15px; margin-top: 2px; }
.kv { gap: 12px; margin: 0 0 16px; }
.kv div { padding: 10px 8px; }
.kv b { font-size: 28px; line-height: 1.1; }
.kv b small { font: 400 15px var(--book); color: var(--muted); }
.kv span { font: 600 11.5px var(--serif); letter-spacing: .16em; color: var(--gold); }
.lands .chip { font-size: 15px; padding: 4px 13px; }

/* country card */
.bigletter { font-size: 56px; width: 70px; }
.statrow { font-size: 15.5px; }
.cityrow { font-size: 15px; padding: 4px 12px; }
.fine { font-size: 13.5px; }
.neighbours { margin-top: 14px; }
.rel { font-size: 12px; }

/* orders */
.draft { padding: 16px; min-height: 110px; }
.seq { font-size: 17px; }
.seq .node { padding: 1px 10px; }
.order { padding: 12px 14px; gap: 12px; margin-top: 12px; }
.order .desc { font-size: 14.5px; line-height: 1.5; margin-top: 4px; }
.order .num { font-size: 15px; }
.kindtag { font-size: 12px; padding: 2px 10px; }
#draftDesc { font-size: 14.5px !important; line-height: 1.5; }
.pct { font-size: 14px; grid-template-columns: 30px 1fr 56px; }
.submitbar { margin-top: 20px; padding-top: 18px; }
#oSubmit { padding: 14px; font-size: 16px; letter-spacing: .12em; text-transform: uppercase; }
.locked { font-size: 15.5px; }
.pl-row { font-size: 13px; }
.pl-head { font-size: 13px; }

/* log and rules */
.logturn b { font: 600 15px var(--serif); letter-spacing: .12em; color: var(--gold2); margin-right: 10px; }
.logturn pre { font: 15px/1.6 var(--book); color: #d7d2c4; }
.rules section + section { margin-top: 18px; }
.rules h4 { margin: 0 0 8px; font: 600 14px var(--serif); letter-spacing: .2em; text-transform: uppercase; color: var(--gold2); display: flex; align-items: center; gap: 12px; }
.rules h4::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, #d9a93f88, transparent); }
.rules dl { margin: 0; }
.rules dt { font: 600 15px var(--serif); letter-spacing: .08em; color: var(--gold); margin-top: 10px; }
.rules dd { margin: 2px 0 0; font-size: 15.5px; line-height: 1.6; color: #d7d2c4; }
.rules p { margin: 8px 0 0; font-size: 15.5px; line-height: 1.6; color: #d7d2c4; }
.rules b { color: var(--gold2); font-weight: 600; }

/* game bar and strip */
.gtitle { font-size: 22px; }
.phase { font-size: 14.5px; }
.pcard { padding: 5px 16px 5px 6px; gap: 10px; font-size: 15px; }
.pcard small { font-size: 12.5px; }
.pcard .avatar { width: 36px !important; height: 36px !important; font-size: 16px; }
.dock .btn { font-size: 13px; padding: 7px 14px; }
.maptools .btn { font-size: 14px; padding: 6px 14px; }
.maptools label { font-size: 14px; }

/* hover card */
.tip { width: 330px; padding: 18px 22px 16px; font-size: 15px; }
.tip .bigletter { font-size: 48px; width: 60px; }
.tip .infohead .ih .rel.main { font-size: 17px; }

/* battle and replay */
.odds { height: 38px; margin: 26px 0 34px; }
.odds .seg { font-size: 13px; }
.odds .marker::after { font-size: 13px; }
.cine-card { width: min(700px, 64%); padding: 24px 30px; }
.kicker { font-size: 12.5px; }
.headline { font-size: 36px; margin: 6px 0 12px; }
.caption { font-size: 17px; line-height: 1.6; }
.cine-card .desc, .cine-card .muted { font-size: 15px; }
.stat { font-size: 14px; padding: 4px 12px; }
.stamp { font-size: 26px; }
.cine-score .pcard { font-size: 14px; }
.cine-title { font-size: 17px; }
.toast { font-size: 15.5px; padding: 14px 18px; }

/* lobby */
.gamecard { padding: 18px 20px; font-size: 15px; }
.gamecard b { font: 600 20px var(--serif); letter-spacing: .05em; }
.authcard { max-width: 460px; }

@media (min-width: 901px) {
  body.immersive .col-left { width: 370px; }
  body.immersive .col-right { width: 430px; }
  body.immersive [data-pane="log"] { width: min(820px, calc(100vw - 24px)); }
  body.immersive .scroll { max-height: 38vh; }
}


@media (max-width: 900px) {
  .card { padding: 14px 16px; }
  .cine-card { width: auto; padding: 14px 16px; }
  .headline { font-size: 24px; }
  .tip { width: 280px; }
}

/* ---- replay cards: one consistent layout (kicker, headline, subtitle, detail) ---- */
.cine-card { width: min(720px, 66%); min-height: 260px; padding: 26px 32px 24px; }
.headline { background: none; -webkit-text-fill-color: initial; color: #fff3d0; font-size: 32px; line-height: 1.2; margin: 6px 0 4px; text-shadow: 0 2px 10px #000a; }
.sub { font-size: 18px; color: #cfc6b0; margin: 2px 0 14px; }
.caption { font-size: 18px; min-height: 0; margin: 6px 0 10px; }
.caption:empty { display: none; }
.who { font-family: var(--serif); font-weight: 700; letter-spacing: .04em; white-space: nowrap; text-shadow: 0 0 1px #000, 0 1px 4px #000; }
.sw-dot { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; border: 1px solid #0008; }
.plus { color: var(--gold); font-style: italic; font-weight: 400; margin: 0 4px; }
.cine-card .seq { font-size: 18px; }
.arow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 0; border-top: 1px solid #d9a93f26; font-size: 16px; }
.arow:first-of-type { border-top: none; }
.arow .desc { flex-basis: 100%; font-size: 16px; line-height: 1.5; color: #d7d2c4; }
.arow .army { color: #d7d2c4; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 6px 0 12px; }
.tile { text-align: center; padding: 10px 6px; border: 1px solid #d9a93f33; border-radius: 4px; background: #0b0e1999; }
.tile b { display: block; font: 700 30px/1.1 var(--serif); color: var(--gold2); }
.tile span { font: 600 12px var(--serif); letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.note { font-size: 15.5px; font-style: italic; color: #cfc6b0; margin: 4px 0; }
.note.bad { color: #e48a93; font-style: normal; }
.chips { margin-top: 10px; }
.resultrow { display: flex; align-items: center; gap: 20px; min-height: 64px; margin-top: 6px; font-size: 16.5px; line-height: 1.5; }
.resultrow.pending { visibility: hidden; }
.resulttext { flex: 1; }
.resulttext b { color: var(--gold2); }
.resultrow .stamp { font-size: 24px; white-space: nowrap; }
.cine-card table.t { font-size: 16.5px; }
@media (max-width: 900px) {
  .cine-card { width: auto; min-height: 0; padding: 14px 16px; }
  .headline { font-size: 22px; }
  .sub, .caption { font-size: 15px; }
  .tile b { font-size: 22px; }
}

/* Replay panels stay see-through so the arrows beneath remain readable. */
.cine-card { background: radial-gradient(120% 100% at 50% 0%, #1f2644a6, #0b0e19a6 70%); backdrop-filter: blur(1.5px); box-shadow: inset 0 0 0 3px #0b0e1966, inset 0 0 0 4px #d9a93f44, 0 14px 50px #0008; }
.cine-score .pcard { background: #0d122099; }
.cine-card .headline, .cine-card .sub, .cine-card .caption, .cine-card .desc, .cine-card .note { text-shadow: 0 1px 3px #000, 0 0 8px #000c; }

/* ---- battle drama ---- */
.cine-stage.shake { animation: stageShake .7s cubic-bezier(.36, .07, .19, .97); }
@keyframes stageShake {
  10%, 90% { transform: translate(-2px, 1px); } 20%, 80% { transform: translate(4px, -2px); }
  30%, 50%, 70% { transform: translate(-9px, 3px); } 40%, 60% { transform: translate(9px, -3px); }
}
#cineFlash { position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: 0; }
#cineFlash.good { background: radial-gradient(circle at 50% 55%, #8af0b266, #0000 70%); animation: flash 1s ease-out; }
#cineFlash.bad { background: radial-gradient(circle at 50% 55%, #f0707a66, #0000 70%); animation: flash 1s ease-out; }
#cineFlash.gold { background: radial-gradient(circle at 50% 55%, #f1d78a66, #0000 70%); animation: flash 1s ease-out; }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }

.odds.rolling .odds-track { animation: throb .45s ease-in-out infinite alternate; }
@keyframes throb { from { box-shadow: inset 0 0 0 2px #0b0e19, 0 0 10px #d9a93f44; } to { box-shadow: inset 0 0 0 2px #0b0e19, 0 0 36px #f1d78acc; } }
.odds.rolling .sword { animation: tremble .1s linear infinite alternate; }
@keyframes tremble { from { transform: translateX(-50%) rotate(-3deg); } to { transform: translateX(-50%) rotate(3deg); } }
.odds.done .sword { animation: strike .55s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes strike { from { transform: translateX(-50%) translateY(-26px) rotate(10deg) scale(1.3); } }

.resultrow .stamp { position: relative; animation: slam .7s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes slam {
  0% { transform: rotate(-4deg) scale(5); opacity: 0; }
  55% { transform: rotate(-4deg) scale(.86); opacity: 1; }
  75% { transform: rotate(-4deg) scale(1.1); }
  100% { transform: rotate(-4deg) scale(1); opacity: 1; }
}
.resultrow .stamp::after { content: ''; position: absolute; inset: -4px; border: 3px solid currentColor; border-radius: 6px; opacity: 0; animation: ring .9s ease-out .35s both; }
@keyframes ring { from { transform: scale(1); opacity: .9; } to { transform: scale(2.4, 2.8); opacity: 0; } }
.resulttext { animation: fadeup .5s ease-out .5s both; }
@keyframes fadeup { from { opacity: 0; transform: translateY(8px); } }

.tile em.loss { display: block; min-height: 1.3em; font: 700 19px var(--serif); font-style: normal; color: #f08a93; }
.tile em.loss.pending { visibility: hidden; }
.tile em.loss:not(.pending) { animation: lossrise 1s ease-out .4s both; }
@keyframes lossrise { from { opacity: 0; transform: translateY(14px) scale(1.8); } 60% { opacity: 1; } }
