/* ============================================================
   UOWOS medieval theme layer
   ------------------------------------------------------------
   Loaded AFTER app.css and only overrides presentation: fonts,
   spacing, rules and borders. No layout structure is changed,
   so removing this file returns the site to the previous look.

   Artwork comes from the UI sheet in /assets/img/ui/, cut out of
   the sheet the same way the launcher's assets were.
   ============================================================ */

:root {
    /* MedievalSharp reads as a novelty face at small sizes; Cinzel is the
       spaced Roman capital the mock-up actually uses. */
    --font-display: "Cinzel", "Trajan Pro", "Times New Roman", Georgia, serif;
    --font-brand:   "Cinzel Decorative", "Cinzel", "Trajan Pro", serif;

    --rule-gold: linear-gradient(90deg, rgba(212,168,74,0), rgba(212,168,74,.75) 20%, rgba(212,168,74,.75) 80%, rgba(212,168,74,0));
}

/* The home grid sizes itself (70% of viewport, capped at 1400px); capping
   its wrapper as well squeezed the columns, so leave the measure alone. */

/* ---------- header ---------- */
.site-header {
    border-bottom: 1px solid rgba(212,168,74,.35);
    box-shadow: inset 0 -3px 8px rgba(0,0,0,.55), 0 2px 10px rgba(0,0,0,.5);
}
.site-header .brand-mark,
.site-header .brand-name {
    font-family: var(--font-brand);
    letter-spacing: .10em;
}
.nav-main a {
    font-family: var(--font-display);
    font-size: .95rem;
    letter-spacing: .045em;
}

/* ---------- headings ---------- */
h1, h2, h3 {
    font-family: var(--font-display);
    letter-spacing: .055em;
    font-weight: 600;
}

/* Panel headings: centred small caps over the carved divider from the sheet. */
.card > h2:first-child,
.card > h3:first-child,
.panel > h2:first-child,
.panel > h3:first-child {
    text-align: center;
    text-transform: uppercase;
    font-size: 1.02rem;
    color: var(--gold-hi);
    text-shadow: 0 1px 2px rgba(0,0,0,.9);
    margin: 2px 0 14px;
    padding-bottom: 18px;
    /* the divider is sized by HEIGHT: sizing it by width blew it up to ~90px
       on wide cards and the artwork swallowed the heading text */
    background: url("/assets/img/ui/div-orn.png") no-repeat bottom center;
    background-size: auto 13px;
}

/* ---------- panels ----------
   panel-corner.png is a plain dark plate with gilded corner brackets; as a
   9-slice it stretches to any card size without smearing the ornament. */
.card, .card-stone, .panel {
    border: 20px solid transparent;
    border-image: url('/assets/img/ui/panel-corner.png') 20 fill stretch;
    border-radius: 0;
    background-color: transparent;
    box-shadow: 0 10px 26px rgba(0,0,0,.5);
    padding: 12px 16px 16px;
}
.card + .card, .panel + .panel { margin-top: 14px; }

/* ---------- body copy ---------- */
body { font-family: var(--font-body); }
p, li, td, .hint { line-height: 1.55; }

/* ---------- buttons ---------- */
.btn {
    font-family: var(--font-display);
    letter-spacing: .06em;
    text-transform: uppercase;
    font-size: .86rem;
    border-radius: 2px;
}
/* Primary actions use the carved plate from the sheet: Register, Log out,
   Full changelog, Open in Discord, Open forum, Download client. Ranking tabs
   and the map zoom controls stay flat - they are toggles, not actions. */
.btn-gold,
.nav-right .btn-ghost,
.home-side .btn-ghost,
.changelog-panel .btn-ghost {
    /* the plate is 243x63; a 22px border on a 36px-tall button made the
       artwork bloat, so the vertical border is kept thin */
    /* the plate is 243x63 and its end ornaments are ~58px wide, so that is
       where the horizontal slice has to fall; a 24px slice cut through the
       ornament and the leftover got stretched across the whole button */
    border-width: 9px 26px;
    border-style: solid;
    border-color: transparent;
    border-image: url("/assets/img/ui/btn-dark.png") 10 58 fill stretch;
    background: none;
    color: var(--gold-hi);
    text-shadow: 0 1px 2px #000;
    padding: 1px 4px;
    line-height: 1.15;
    font-size: .82rem;
    box-shadow: none;
    transition: filter .13s ease;
}
.btn-gold:hover,
.nav-right .btn-ghost:hover,
.home-side .btn-ghost:hover,
.changelog-panel .btn-ghost:hover {
    filter: brightness(1.25) drop-shadow(0 0 10px rgba(212,168,74,.5));
    border-color: transparent;
    color: var(--gold-hi);
    /* app.css puts a rectangular glow on .btn-gold:hover; with the carved
       plate that glow shows up as a yellow box around the button */
    box-shadow: none;
    background: none;
}
.btn-gold:active,
.nav-right .btn-ghost:active,
.home-side .btn-ghost:active,
.changelog-panel .btn-ghost:active { filter: brightness(.92); }

.btn-ghost {
    border: 1px solid rgba(212,168,74,.35);
    background: linear-gradient(180deg, rgba(60,44,26,.55), rgba(28,20,12,.75));
    color: var(--text);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-hi); }

/* Shop and Donate keep their own colours from the sheet. */
.nav-shop:hover, .nav-donate:hover, .nav-casino:hover { color: var(--gold-hi); }

/* ---------- tables ---------- */
th {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: .05em;
    font-size: .82rem;
    color: var(--gold);
}

/* ---------- trim ---------- */
hr {
    border: 0;
    height: 19px;
    background: url('/assets/img/ui/div-line.png') no-repeat center;
    background-size: contain;
}
a { text-decoration: none; }

/* The download page draws its own carved buttons, so keep the plate off them. */
.btn-art, .btn-art:hover { border: 0; border-image: none; background: none; filter: none; }

/* Nested cards (changelog entries, forum rows) keep a plain hairline so we
   don't stack a carved frame inside a carved frame. */
.card .card, .cl-entry {
    border: 1px solid rgba(212,168,74,.20) !important;
    border-image: none !important;
    background-color: rgba(12,9,6,.45);
    padding: 12px 14px;
    box-shadow: none;
}

/* Video tile: when the YouTube thumbnail fails to load, the anchor gets
   .video-fallback and shows our own frame with a play glyph instead of a
   broken-image box. */
.home-videos a { display: block; position: relative; min-height: 120px; }
.home-videos a.video-fallback {
    background:
        linear-gradient(180deg, rgba(30,22,14,.9), rgba(12,9,6,.95)),
        url('/assets/img/ui/frame-video.png') center / 100% 100% no-repeat;
}
.home-videos a.video-fallback::after {
    content: '\25B6';
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 34px; color: var(--gold-hi);
    text-shadow: 0 2px 8px rgba(0,0,0,.8);
}

/* "36 active in past 24h" wrapped onto two lines inside the narrow status
   card - keep it on one line and let it shrink instead. */
.home-status .server-state-label {
    white-space: nowrap;
    font-size: .92rem;
    letter-spacing: .01em;
}

/* ---------- home: daily schedule card ---------- */
.daily-list { list-style: none; margin: 0 0 10px; padding: 0; }
.daily-list li {
    display: flex; gap: 10px; align-items: baseline;
    padding: 5px 0; border-bottom: 1px solid rgba(212,168,74,.12);
}
.daily-list .dl-time { color: var(--gold-hi); font-weight: 700; min-width: 46px; }
.daily-list .dl-name { color: var(--text); }
.daily-note { margin: 8px 0 0; color: var(--text-dim); }
.daily-note strong { color: var(--gold); }
.daily-sub {
    margin: 16px 0 6px; text-align: center; text-transform: uppercase;
    color: var(--gold-hi); font-size: .95rem; letter-spacing: .05em;
}
.daily-lede { margin: 0 0 8px; color: var(--text-dim); font-size: .92rem; }
.daily-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin-bottom: 8px; }
.daily-table th { text-align: left; padding: 4px 6px; }
.daily-table td { padding: 4px 6px; border-top: 1px solid rgba(212,168,74,.12); color: var(--text); }
.daily-table td:last-child { text-align: right; color: var(--gold-hi); white-space: nowrap; }

/* ---------- home: world map card ---------- */
.home-map { display: block; text-decoration: none; }
.home-map-shot {
    display: block; overflow: hidden; border: 1px solid rgba(212,168,74,.25);
}
.home-map-shot img { width: 100%; display: block; transition: transform .25s ease, filter .25s ease; }
.home-map:hover .home-map-shot img { transform: scale(1.03); filter: brightness(1.1); }

/* the active-players line reads too small next to the big online counter */
.home-status .server-state-label { font-size: 1.1rem; }

/* ---------- home: changelog as one carved panel ---------- */
.changelog-panel { padding: 14px 16px 16px; }
.changelog-panel .home-section-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 12px; padding-bottom: 12px;
    border-bottom: 1px solid rgba(212,168,74,.22);
}
.changelog-panel .home-section-head h2 {
    margin: 0; font-size: 1.05rem; text-transform: uppercase; color: var(--gold-hi);
}
.changelog-panel .home-changelog { margin: 0; padding: 0; list-style: none; }
/* entries share the grey field of the status card rather than each carrying
   their own carved frame */
.changelog-panel .cl-entry {
    background-color: rgba(38,32,26,.55);
    border: 1px solid rgba(212,168,74,.18) !important;
    margin-bottom: 12px;
}

/* Toggles keep the flat look so they read as state, not as actions. */
.rank-tabs .btn-ghost, .map-zooms .btn-ghost, .rank-tab {
    border-image: none !important;
    border: 1px solid rgba(212,168,74,.35) !important;
    background: linear-gradient(180deg, rgba(60,44,26,.55), rgba(28,20,12,.75)) !important;
    filter: none !important;
}

/* ---------- measure on the fixed 1280px viewport ----------
   The site pins the viewport to width=1280, so phones render the desktop
   layout scaled down. The hero and grid were sized at 70% of the viewport,
   which is fine on a 1920 monitor but leaves only ~900px for three columns
   at 1280 - hence the cramped look on a phone. Below 1500px the layout now
   uses nearly the full width instead; wide monitors keep the 1400px cap. */
@media (max-width: 1500px) {
    .page-hero,
    body.has-big-hero .home-grid,
    body.has-big-hero .site-main > .wrap > .flash {
        width: 97%;
        max-width: 1400px;
    }
}

/* Buttons that carry the carved plate must not also keep their old
   rectangular decoration from app.css - the wood background, the box glow
   and the sheen animation all render as a yellow box around the plate. */
.home-donate .donate-btn,
.pass-page .btn-gold,
.donate-tier .donate-btn,
.donate-tier .donate-btn:hover,
.home-donate .donate-btn:hover,
.pass-page .btn-gold:hover {
    background: none !important;
    background-image: none !important;
    box-shadow: none !important;
    animation: none !important;
    border-color: transparent !important;
}
.home-donate .donate-btn::before { display: none !important; }

/* Every carved-plate button, wherever it appears: no legacy rectangle behind
   it, and enough height that the 9-slice plate keeps its proportions. */
.btn.btn-gold,
.btn.btn-gold:hover,
.btn.btn-gold:active,
.btn.btn-gold:focus {
    background: none !important;
    background-image: none !important;
    box-shadow: none !important;
    animation: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
}
/* the large variant (donate CTA) gets a proportionally thicker frame */
.btn.btn-gold.lg { min-height: 42px; border-width: 12px 30px; font-size: .9rem; }
/* disabled tiers must not look clickable */
.btn.btn-gold[disabled] { filter: grayscale(.7) brightness(.7); cursor: not-allowed; }

/* ...but the ACTIVE toggle must keep its gold fill: the flat rule above was
   overriding .rank-tab.active's background while its dark text colour stayed,
   which left the selected tab unreadable. */
.rank-tab.active,
.rank-tabs .btn-ghost.is-active,
.map-zooms .btn-ghost.is-active {
    background: linear-gradient(180deg, #e2b859, #c1922f) !important;
    color: #1a1206 !important;
    border-color: var(--gold-hi) !important;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(212,168,74,.28) !important;
    text-shadow: none;
}
/* the Pass page paints its active tab salmon - keep that */
.pass-page .rank-tab.active {
    background: #ff9a8a !important;
    border-color: #ff9a8a !important;
    box-shadow: 0 2px 10px rgba(255,154,138,.28) !important;
}

/* ---------- Support the Shard: proper carved frame ----------
   frame-gold.png is a full portrait frame, so it is used WITHOUT `fill`:
   the centre stays transparent and the card keeps its own treasure backdrop.
   Slice 120 drawn at 30px scales the corner diamonds down to a sane size. */
.card-stone.home-donate {
    /* No border on the card itself: the backdrop fills the whole box, and the
       frame is painted on top as an overlay. That way the art always meets the
       gold exactly - no inner gap, no spill past it. */
    position: relative;
    border: 0 !important;
    border-image: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 26px 26px 26px !important;
    background-clip: border-box !important;
    background-origin: border-box !important;
    background-size: cover !important;
    background-position: center !important;
}
.card-stone.home-donate::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    display: block !important;
    width: auto; height: auto;
    background: none;
    border: 20px solid transparent;
    border-image: url("/assets/img/ui/frame-gold.png") 80 stretch;
    transform: none;
}
/* app.css hangs decorative gems on these; ::after is now the frame overlay */
.card-stone.home-donate::before { display: none !important; }
/* the heading divider from the same set, matched to this frame */
.card-stone.home-donate > h3:first-child {
    background: url('/assets/img/ui/div-fancy.png') no-repeat bottom center;
    background-size: auto 15px;
    padding-bottom: 20px;
}
/* and its own plate for the shop button */
.home-donate .donate-btn {
    /* kill the wood texture from app.css - it was showing as a pale rectangle
       around the carved plate */
    background: none !important;
    background-image: none !important;
    box-shadow: none !important;
    animation: none !important;
    border-width: 14px 34px !important;
    border-style: solid !important;
    border-color: transparent !important;
    border-image: url('/assets/img/ui/btn-shop.png') 23 62 fill stretch !important;
    color: var(--gold-hi) !important;
    text-shadow: 0 1px 2px #000 !important;
    min-height: 44px;
    font-size: .88rem;
}
.home-donate .donate-btn:hover {
    filter: brightness(1.22) drop-shadow(0 0 12px rgba(212,168,74,.55));
}

/* The donate panel and its button must sit perfectly still: any hover shift,
   glow or filter makes the overlaid frame look warped as it re-renders. */
.card-stone.home-donate:hover,
.card-stone.home-donate:focus-within {
    box-shadow: none !important;
    border-color: transparent !important;
    transform: none !important;
    filter: none !important;
}
.card-stone.home-donate:hover::after,
.card-stone.home-donate::after {
    transform: none !important;
    filter: none !important;
    transition: none !important;
}
.home-donate .donate-btn,
.home-donate .donate-btn:hover,
.home-donate .donate-btn:active,
.home-donate .donate-btn:focus {
    transform: none !important;
    filter: none !important;
    transition: color .12s ease !important;
}
/* the only hover feedback left: the lettering brightens */
.home-donate .donate-btn:hover { color: #fff2c4 !important; }

/* Bring the sheen back to the shop button. It lives on the pseudo-element,
   not on the button itself, so nothing transforms the plate or the frame. */
.home-donate .donate-btn {
    position: relative;
    overflow: hidden;
}
.home-donate .donate-btn::before {
    content: '' !important;
    display: block !important;
    position: absolute;
    top: 0; bottom: 0; left: -40%;
    width: 30%;
    background: linear-gradient(100deg,
        transparent 0%,
        rgba(255,240,200,0) 10%,
        rgba(255,240,200,.38) 50%,
        rgba(255,240,200,0) 90%,
        transparent 100%);
    transform: skewX(-20deg);
    animation: donate-sheen 3.6s linear infinite;
    pointer-events: none;
    z-index: 1;
}
.home-donate .donate-btn:hover::before { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
    .home-donate .donate-btn::before { animation: none; }
}
