/* Shadowfall site - "medieval" theme (default; ?stil=clasic = the first design). Loaded after site.css and only
   overrides it. Frames, title band, buttons, tabs and cursor are the game's own painted UI (assets/ui/skin, copied to
   img/ui); parchment, wax seals, rivets and rune stones are drawn here. */
@font-face { font-family: "IM Fell"; src: url("../fonts/IMFell-Regular.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "IM Fell"; font-style: italic; src: url("../fonts/IMFell-Italic.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Uncial"; src: url("../fonts/UncialAntiqua.woff2") format("woff2"); font-display: swap; }

:root {
  --fell: "IM Fell", "Palatino Linotype", Georgia, serif;
  --parch: #dcc79c;
  --parch2: #c9ae7c;
  --ink: #2b1a0c;
  --ink-soft: #6a5236;
  --wax: #8f161c;
  --iron: #1b1814;
  /* paper fibres: SVG noise, tinted by the multiply blend below */
  --fibres: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .12 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --rivet: radial-gradient(circle at 40% 35%, #f4dc9a 0 1px, #b48a3c 1.6px, #4a3410 2.6px, transparent 3.4px);
}

/* the game's cursor */
body.theme-medieval { cursor: url("../img/ui/cursor.png") 3 2, auto; }
.theme-medieval a, .theme-medieval button, .theme-medieval label.checkbox, .theme-medieval select, .theme-medieval summary,
.theme-medieval .nav-burger { cursor: url("../img/ui/cursor_take.png") 8 4, pointer; }
.theme-medieval input { cursor: text; }

/* scrollbar from the game */
.theme-medieval ::-webkit-scrollbar { width: 12px; }
.theme-medieval ::-webkit-scrollbar-track { background: #0a0908 url("../img/ui/scroll_track.png") center / 12px 100% no-repeat; }
.theme-medieval ::-webkit-scrollbar-thumb { background: url("../img/ui/scroll_thumb.png") center / 12px 100% no-repeat; min-height: 60px; }

/* headings, kickers, nav */
.theme-medieval .kicker::before, .theme-medieval .kicker::after { content: "✦"; color: var(--wax); margin: 0 .7em 0 0; font-size: .7em; vertical-align: .15em; }
.theme-medieval .kicker::after { margin: 0 0 0 .7em; }
.theme-medieval .nav a:not(.btn) { position: relative; font-family: var(--serif); font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; }
.theme-medieval .nav a:not(.btn)::after {
  content: ""; position: absolute; left: 50%; right: 50%; bottom: -8px; height: 7px; opacity: 0;
  background: linear-gradient(90deg, transparent, var(--gold) 30% 70%, transparent) center / 100% 1px no-repeat,
              linear-gradient(45deg, transparent 40%, var(--wax) 40% 60%, transparent 60%) center / 7px 7px no-repeat;
  transition: left .25s, right .25s, opacity .25s;
}
.theme-medieval .nav a:not(.btn):hover::after, .theme-medieval .nav a.on:not(.btn)::after { left: 0; right: 0; opacity: 1; }
.theme-medieval .prose > p:first-of-type::first-letter, .theme-medieval .lead.dropcap::first-letter {
  float: left; font: 3.6em/.8 "Uncial", var(--serif); color: var(--gold2); margin: .08em .12em 0 0;
  text-shadow: 0 0 18px #c9a14a55, 2px 2px 0 var(--wax);
}
.theme-medieval blockquote { font-family: var(--fell); font-style: italic; font-size: 1.25rem; border-left: 0; position: relative; padding-left: 3.2em; }
.theme-medieval blockquote::before { content: "❧"; position: absolute; left: .7em; top: .35em; font-size: 1.8em; color: var(--wax); }

/* ---- panels: the game's window frame (9-slice) on its woven charcoal ---- */
.theme-medieval .panel, .theme-medieval .feature, .theme-medieval .class-card, .theme-medieval .dl-card,
.theme-medieval .news-card, .theme-medieval .faq details, .theme-medieval .place {
  border: 20px solid transparent; border-image: url("../img/ui/panel_plain.png") 40 / 20px; border-radius: 0;
  background: url("../img/ui/panel_weave_dark.png") 0 0 / 128px; background-clip: padding-box; padding: 10px 12px;
}
.theme-medieval .feature:hover { transform: translateY(-3px); filter: brightness(1.12); }
.theme-medieval .news-card { border-left-width: 20px; }
.theme-medieval .faq details { margin-bottom: 4px; }
.theme-medieval .place img { border: 1px solid #00000088; }

/* ---- the auth card: big game window + burgundy title band ---- */
.theme-medieval .auth-card {
  max-width: 480px; padding: 18px 28px 26px; border: 24px solid transparent;
  border-image: url("../img/ui/panel.png") 48 / 24px; background: url("../img/ui/panel_weave.png") 0 0 / 128px;
  background-clip: padding-box; box-shadow: 0 40px 90px #000e, 0 0 120px #8e1f2422;
}
.theme-medieval .corner { display: none; }
.theme-medieval .auth-card h1 {
  margin: 18px -40px 4px; padding: 14px 40px 12px; font: 600 1.55rem/1.1 var(--serif); letter-spacing: .06em;
  color: #f6e3b4; text-shadow: 0 2px 0 #2a0507, 0 0 20px #e7b85a44;
  border-style: solid; border-color: transparent; border-width: 0 24px; border-image: url("../img/ui/titlebar.png") 0 48 fill / 0 24px;
}
.theme-medieval .auth-sub { font-family: var(--fell); font-style: italic; font-size: 1.05rem; color: #b8a682; margin-top: 10px; }
.theme-medieval .auth-foot { font-family: var(--fell); font-style: italic; font-size: .98rem; }
.theme-medieval .ornament i { width: 11px; height: 11px; }
.theme-medieval .ornament::before, .theme-medieval .ornament::after { content: "❦"; color: #8a7448; font-size: .9rem; }
.theme-medieval .ornament::after { transform: scaleX(-1); }

/* tabs = the game's tabs */
.theme-medieval .seg { padding: 0; gap: 6px; background: none; border: 0; box-shadow: none; }
.theme-medieval .seg a {
  border: 8px solid transparent; border-image: url("../img/ui/tab.png") 8 10 fill / 8px 10px; border-radius: 0;
  padding: .45em; color: #a8987a; font-size: .74rem;
}
.theme-medieval .seg a:hover { border-image-source: url("../img/ui/tab_hover.png"); color: var(--gold2); }
.theme-medieval .seg a.on { border-image-source: url("../img/ui/tab_active.png"); background: none; box-shadow: none; color: #f6e3b4; text-shadow: 0 1px 0 #2a0507; }

/* ---- fields: parchment strips held by four rivets in an iron slot ---- */
.theme-medieval .field-label { font: 400 .95rem/1 var(--fell); letter-spacing: .04em; text-transform: none; color: #d8c08a; }
.theme-medieval .field-label::before { content: "❧ "; color: var(--wax); }
.theme-medieval .control { padding: 4px; background: linear-gradient(180deg, #2a241c, #12100c); box-shadow: inset 0 0 0 1px #000, 0 0 0 1px #5d4a2a, 0 3px 10px #000a; }
.theme-medieval .control::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--rivet) 0 0 / 9px 9px no-repeat, var(--rivet) 100% 0 / 9px 9px no-repeat,
              var(--rivet) 0 100% / 9px 9px no-repeat, var(--rivet) 100% 100% / 9px 9px no-repeat;
  background-origin: content-box; padding: 0;
}
.theme-medieval .control input {
  height: 48px; border: 0; border-radius: 1px; font: 1.22rem var(--fell); color: var(--ink); caret-color: var(--wax);
  background: var(--fibres), radial-gradient(ellipse at 50% 50%, var(--parch) 55%, var(--parch2) 100%);
  background-blend-mode: multiply;
  box-shadow: inset 0 0 0 1px #8a6d3f, inset 0 0 14px #6b4a1e99, inset 0 0 3px #3b2610;
  padding-top: 2px;
}
.theme-medieval .control input::placeholder { color: #8a714d; font-style: italic; }
.theme-medieval .control input:hover { border: 0; }
.theme-medieval .control input:focus {
  border: 0; background: var(--fibres), radial-gradient(ellipse at 50% 50%, #e6d3aa 55%, var(--parch2) 100%);
  background-blend-mode: multiply;
  box-shadow: inset 0 0 0 1px #8a6d3f, inset 0 0 14px #6b4a1e88, 0 0 0 2px #e0a24a, 0 0 24px #ff9a3c66;
  animation: candle 2.6s ease-in-out infinite;
}
@keyframes candle {
  0%, 100% { box-shadow: inset 0 0 0 1px #8a6d3f, inset 0 0 14px #6b4a1e88, 0 0 0 2px #e0a24a, 0 0 22px #ff9a3c55; }
  45% { box-shadow: inset 0 0 0 1px #8a6d3f, inset 0 0 14px #6b4a1e88, 0 0 0 2px #f0b55a, 0 0 30px #ffae4c77; }
  70% { box-shadow: inset 0 0 0 1px #8a6d3f, inset 0 0 14px #6b4a1e88, 0 0 0 2px #d8963e, 0 0 18px #ff8f3044; }
}
.theme-medieval .control input:-webkit-autofill { -webkit-text-fill-color: var(--ink); -webkit-box-shadow: inset 0 0 0 100px var(--parch); }
.theme-medieval .control-ico { stroke: #6a4f2c; left: 17px; }
.theme-medieval .control:focus-within .control-ico { stroke: var(--wax); }
.theme-medieval .eye { color: #6a4f2c; right: 8px; }
.theme-medieval .eye:hover { color: var(--wax); background: #00000010; }
.theme-medieval .control-state { stroke: #2f6a2a; right: 17px; }
.theme-medieval .control:has(.eye) .control-state { right: 50px; }
/* valid: ink turns deep green, a green thread on the slot; invalid: red ink, blood-red slot */
.theme-medieval .field.is-valid .control { box-shadow: inset 0 0 0 1px #000, 0 0 0 1px #4d6b37, 0 3px 10px #000a; }
.theme-medieval .field.is-valid .control input { border: 0; }
.theme-medieval .field.is-invalid .control { box-shadow: inset 0 0 0 1px #000, 0 0 0 1px #a5363b, 0 0 14px #a5363b44; }
.theme-medieval .field.is-invalid .control input { border: 0; color: #6d0f14; box-shadow: inset 0 0 0 1px #9a4a3a, inset 0 0 16px #8f161c55; }
.theme-medieval .field.is-invalid .control-ico { stroke: var(--wax); }
.theme-medieval .field-msg { font: italic .98rem/1.3 var(--fell); }
.theme-medieval .field.is-invalid .field-msg { color: #e88b8f; }
.theme-medieval .field.is-valid .field-msg { color: #a9cf96; }

/* password strength = four rune stones that light up */
.theme-medieval .strength-bar { flex: none; display: flex; gap: 8px; }
.theme-medieval .strength-bar i {
  width: 26px; height: 26px; border-radius: 0; display: grid; place-items: center;
  background: linear-gradient(160deg, #3a332a, #1a1612); clip-path: polygon(50% 0, 100% 30%, 88% 100%, 12% 100%, 0 30%);
  font: normal 15px/1 "Segoe UI Historic", "Segoe UI Symbol", serif; color: #5c5244; transition: background .3s, color .3s, text-shadow .3s;
}
.theme-medieval .strength-bar i::before { content: "ᚠ"; }
.theme-medieval .strength-bar i:nth-child(2)::before { content: "ᚱ"; }
.theme-medieval .strength-bar i:nth-child(3)::before { content: "ᛟ"; }
.theme-medieval .strength-bar i:nth-child(4)::before { content: "ᛉ"; }
.theme-medieval .strength[data-level="1"] i:nth-child(-n+1) { background: linear-gradient(160deg, #5a1a1c, #2a0b0c); color: #ff6b6b; text-shadow: 0 0 8px #ff3b3b; }
.theme-medieval .strength[data-level="2"] i:nth-child(-n+2) { background: linear-gradient(160deg, #5c3416, #2a170a); color: #ffae5c; text-shadow: 0 0 8px #ff8a2a; }
.theme-medieval .strength[data-level="3"] i:nth-child(-n+3) { background: linear-gradient(160deg, #5c4a1a, #2a210a); color: #ffd978; text-shadow: 0 0 8px #ffc23a; }
.theme-medieval .strength[data-level="4"] i { background: linear-gradient(160deg, #24461f, #0f200d); color: #a6ff8f; text-shadow: 0 0 10px #6dff4a; }
.theme-medieval .strength-label { font: italic 1rem var(--fell); color: #a8987a; text-align: left; }
.theme-medieval .rules { font: .95rem var(--fell); gap: 4px 16px; }
.theme-medieval .rules svg { border-color: #6a5a40; }
.theme-medieval .rules li.ok { color: #d8c08a; }
.theme-medieval .rules li.ok svg { color: #f3dca0; background: var(--wax); border-color: #c9a14a; }

/* checkbox = wax seal pressed on the parchment */
.theme-medieval .checkbox { font: 1.05rem/1.4 var(--fell); color: #d3c3a0; gap: 14px; align-items: center; }
.theme-medieval .checkbox .box {
  width: 34px; height: 34px; margin: 0; border-radius: 50%; border: 1px dashed #8a7448; background: #00000033; box-shadow: none;
}
.theme-medieval .checkbox .box svg { display: none; }
.theme-medieval .checkbox:hover .box { border-color: var(--gold2); background: #c9a14a11; }
.theme-medieval .checkbox input:checked + .box {
  border: 0; border-radius: 47% 53% 50% 46% / 52% 46% 54% 48%;
  background: radial-gradient(circle at 35% 30%, #d0434a 0 12%, #a3171e 40%, #6e0c11 72%, #4a070a 100%);
  box-shadow: 0 2px 4px #000c, inset 0 -2px 4px #0006, inset 0 2px 3px #ff8a8a55;
  animation: stamp .35s cubic-bezier(.2, 1.4, .4, 1) both;
}
.theme-medieval .checkbox input:checked + .box::after {
  content: "✠"; font: 18px/1 var(--serif); color: #e7c26a; text-shadow: 0 1px 0 #3a0306, 0 -1px 0 #ffe0a033;
}
@keyframes stamp { 0% { transform: scale(1.8) rotate(-25deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1) rotate(0); } }
.theme-medieval .checkbox input:focus-visible + .box { outline: 2px solid var(--gold2); outline-offset: 3px; }
.theme-medieval .field.is-invalid .checkbox .box { border-color: #d24b51; }

/* alerts = a parchment note with a red wax drop */
.theme-medieval .alert {
  position: relative; border: 0; padding: .75em 1em .75em 3em; font: 1.08rem/1.35 var(--fell);
  background: var(--fibres), linear-gradient(180deg, #e2cfa6, #cdb382); background-blend-mode: multiply;
  color: #4b0f12; clip-path: polygon(0 4%, 3% 0, 30% 3%, 62% 0, 97% 2%, 100% 30%, 99% 72%, 100% 100%, 64% 97%, 31% 100%, 2% 97%, 0 70%);
}
.theme-medieval .alert svg { position: absolute; left: .9em; top: 50%; margin-top: -9px; color: var(--wax); }
.theme-medieval .alert-ok { color: #233d17; }
.theme-medieval .alert-ok svg { color: #2f6a2a; }

/* ---- buttons ---- */
/* primary: forged gold plaque, engraved letters, a rivet at each end */
.theme-medieval .btn-gold { --cut: 12px; font-family: var(--serif); letter-spacing: .18em; text-shadow: 0 1px 0 #ffeab0, 0 -1px 0 #7a551d; }
.theme-medieval .btn-gold::before {
  background: var(--rivet) 14px 50% / 9px 9px no-repeat, var(--rivet) calc(100% - 14px) 50% / 9px 9px no-repeat,
              linear-gradient(90deg, #00000022, transparent 12% 88%, #00000022),
              linear-gradient(180deg, #f3d68c 0%, #d8ab55 45%, #ba8b36 55%, #8c6220 100%);
}
.theme-medieval .btn-gold:hover { filter: brightness(1.1); text-shadow: 0 1px 0 #ffeab0, 0 0 14px #fff1c0; }
.theme-medieval .btn-lg.btn-gold::before {
  background: var(--rivet) 18px 50% / 9px 9px no-repeat, var(--rivet) calc(100% - 18px) 50% / 9px 9px no-repeat,
              linear-gradient(90deg, transparent 30px, #7a551d55 30px 31px, transparent 31px calc(100% - 31px), #7a551d55 calc(100% - 31px) calc(100% - 30px), transparent calc(100% - 30px)),
              linear-gradient(180deg, #f3d68c 0%, #d8ab55 45%, #ba8b36 55%, #8c6220 100%);
}
.theme-medieval .btn-lg.btn-gold { padding: 0 3em; }
.theme-medieval .nav .btn-gold::before { background: linear-gradient(180deg, #f3d68c 0%, #d8ab55 45%, #ba8b36 55%, #8c6220 100%); }
/* secondary: the game's own button (9-slice), its hover / pressed states */
.theme-medieval .btn-ghost {
  clip-path: none; background: none; border: 11px solid transparent; border-image: url("../img/ui/button.png") 22 fill / 11px;
  padding: 0 1.4em; min-height: 48px; color: #e9cf8e; letter-spacing: .14em; text-shadow: 0 1px 0 #000;
}
.theme-medieval .btn-ghost::before, .theme-medieval .btn-ghost::after { display: none; }
.theme-medieval .btn-ghost:hover { border-image-source: url("../img/ui/button_hover.png"); filter: none; color: #fff0c4; }
.theme-medieval .btn-ghost:active { border-image-source: url("../img/ui/button_pressed.png"); }
.theme-medieval .btn-ghost.btn-lg { min-height: 56px; }
.theme-medieval .nav .btn-ghost { min-height: 40px; border-width: 9px; }

/* selects: iron plate (the game's button) with a gold chevron */
.theme-medieval select {
  height: 46px; border: 10px solid transparent; border-radius: 0; padding: 0 28px 0 8px; font: 1.1rem var(--fell); color: #e6d3a6;
  border-image: url("../img/ui/button.png") 22 fill / 10px; box-shadow: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e0b860' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 4px center / 15px no-repeat;
}
.theme-medieval select:hover { border-image-source: url("../img/ui/button_hover.png"); }
.theme-medieval .filters label { font: italic 1rem var(--fell); color: #b8a682; }

/* tables: burgundy title band as header */
.theme-medieval .table th {
  color: #f0d9a4; border-bottom: 0; font-family: var(--serif); text-shadow: 0 1px 0 #2a0507;
  background: linear-gradient(180deg, #7a1d25, #4e1016); box-shadow: inset 0 1px 0 #c9a14a, inset 0 -1px 0 #c9a14a, inset 0 2px 0 #00000066;
}
.theme-medieval .table th:first-child { box-shadow: inset 0 1px 0 #c9a14a, inset 0 -1px 0 #c9a14a, inset 1px 0 0 #c9a14a; }
.theme-medieval .table th:last-child { box-shadow: inset 0 1px 0 #c9a14a, inset 0 -1px 0 #c9a14a, inset -1px 0 0 #c9a14a; }
.theme-medieval .table .num { font-family: var(--serif); font-size: .98rem; }
.theme-medieval .table td { font-family: var(--fell); font-size: 1.08rem; }
.theme-medieval .ranking tr.top1 td:first-child::before { content: "♛ "; color: #f3d27a; }

/* footer switch */
.theme-switch { float: right; }
.theme-switch a { color: var(--muted); }
.theme-switch a.on { color: var(--gold2); }

@media (max-width: 620px) {
  .theme-medieval .auth-card { padding: 12px 10px 18px; border-width: 18px; border-image-width: 18px; }
  .theme-medieval .auth-card h1 { margin-left: -28px; margin-right: -28px; font-size: 1.4rem; }
  .theme-medieval .strength-bar i { width: 22px; height: 22px; }
  .theme-switch { float: none; display: block; margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-medieval .control input:focus { animation: none; }
  .theme-medieval .checkbox input:checked + .box { animation: none; }
}
