/* Yo-kai Showdown on Mt. Wildwood's shell (assets/shell.css, fx.css, copied by build/sync_look.py).
   Only Showdown's own pieces live here, on the shell's tokens. Battle art is our own renders; icons are game art. */

:root
{
    --sd-max: 1200px;
    --slot-max: 460px;
    --panel-max: 420px;
    --medal: 56px;
    --medal-s: 22px;
    --box-max: 840px;
    --badge: 26px;
    --render-h: 130px;
    --render: 260px;
    --hp-h: 14px;
    --foe: #c0504d;
    --pin: #d9822b;
    --hp: #3cb371;
    --hp-low: #e3b31d;
    --hp-crit: #d9534f;
    --soul: #8e5bd6;
    --bs: 2px;
    --tw: min(360px, 100vw - 32px);
    --card-w: 210px;
    --chip-w: 140px;
    --kit-w: 230px;
    --kit-icon: 36px;
    --plug-h: 52px;
    --plug-t: 26px;
    --plug-w: 6px;
    --plug-red: #e8201a;
    --approve-w: 220px;
}

.hidden
{
    display: none !important;
}

.skip
{
    position: absolute;
    left: -999px;
}

.skip:focus
{
    left: 8px;
    top: 8px;
    z-index: 300;
}

button.acct-chip, .hero .theme-btn
{
    cursor: pointer;
}

.hero a.dd-btn
{
    text-decoration: none;
}

/* One column: Showdown has no topic sidebar or rail */

.layout.solo
{
    max-width: var(--sd-max);
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "main";
}

body.shell #wrapper.dbpage
{
    text-align: center;
}

body.shell #wrapper.dbpage h1
{
    margin: 4px 0 12px;
    font-size: 30px;
}

/* Panels */

.panel
{
    margin: 0 auto 14px;
}

.panel.narrow
{
    max-width: var(--panel-max);
}

.panels
{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(var(--panel-max), 100%), 1fr));
    justify-items: center;
    gap: 14px;
}

.panels > .panel
{
    width: 100%;
    max-width: var(--panel-max);
    margin: 0;
}

/* Forms, in the Mt. Wildwood team builder style */

.form label, .slot-main label, .bar-row label
{
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    font: 800 var(--fs-xs) var(--head);
    text-transform: uppercase;
    color: var(--link);
    text-align: right;
}

.form label.check
{
    display: flex;
    gap: 8px;
    text-align: left;
    text-transform: none;
    font: 500 var(--fs-base) var(--sans);
    color: var(--ink);
}

body.shell #wrapper input:not([type="checkbox"]), body.shell #wrapper select
{
    box-sizing: border-box;
    width: 100%;
    padding: 3px 6px;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    font: var(--fs-base) var(--sans);
    background: var(--panel);
    color: var(--ink);
    text-transform: none;
}

body.shell #wrapper :is(input, select):focus
{
    border-color: var(--blue);
    outline: none;
}

body.shell #wrapper input[type="checkbox"]
{
    accent-color: var(--blue);
}

.button-row
{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 10px 0 4px;
}

.pill:disabled
{
    opacity: .5;
    cursor: default;
}

body.shell #wrapper .note
{
    color: var(--mut);
    font-size: var(--fs-md);
}

.error
{
    color: var(--ink-red);
    font-weight: 700;
}

.error:empty
{
    display: none;
}

.ibub
{
    margin: 6px auto 22px;
}

.bar-row
{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 16px;
    margin: 0 0 14px;
}

.bar-row label
{
    grid-template-columns: auto minmax(10em, 1fr);
    margin: 0;
}

#demo-row
{
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Team wheel: the Switch Medal menu wheel (641 px), slots 176 px out from the centre, 前後 in the hub swaps the rows */

.team-wheel
{
    position: relative;
    width: var(--tw);
    height: var(--tw);
    margin: 0 auto 16px;
}

.tw-art
{
    display: block;
    width: 100%;
    height: 100%;
}

.tw-slot, .tw-swap
{
    position: absolute;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    cursor: pointer;
}

.tw-slot
{
    left: calc(50% + 27.5% * sin(var(--a)) - 13%);
    top: calc(50% - 27.5% * cos(var(--a)) - 13%);
    width: 26%;
    height: 26%;
}

.tw-slot img
{
    display: block;
    width: 100%;
    height: 100%;
}

.tw-swap
{
    left: 37.5%;
    top: 37.5%;
    width: 25%;
    height: 25%;
}

/* Team: one card per slot, the medal on the game's blue box over the medal burst */

.team-slots
{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
    justify-items: center;
    gap: 14px;
}

.slot.panel
{
    width: 100%;
    max-width: var(--slot-max);
    margin: 0;
}

.slot-top
{
    display: flex;
    align-items: center;
    gap: 10px;
}

.slot-head
{
    position: relative;
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 12px solid transparent;
    border-image: url("../img/ui/box_blue.png") 26 fill / 12px stretch;
}

.slot-head::before
{
    content: "";
    position: absolute;
    inset: -8px;
    background: url("../img/ui/medal_burst.png") center / contain no-repeat;
    opacity: .55;
}

.slot-head img
{
    position: relative;
}

.slot-head .medal
{
    width: var(--medal);
    height: var(--medal);
}

.slot-head .badge + .badge
{
    margin-top: -2px;
}

.slot-main
{
    flex: 1;
    min-width: 0;
}

.slot-main label
{
    grid-template-columns: 82px minmax(0, 1fr) auto;
}

.slot-main label > :nth-child(2)
{
    grid-column: 2 / -1;
}

.slot-main label:has(.shelf-button) > :nth-child(2)
{
    grid-column: auto;
}

.shelf-button
{
    padding: 3px 12px 4px;
    font-size: var(--fs-sm);
}

/* stat table and shelf follow Mt. Wildwood's table.dbt */

.stat-table, table.dbt
{
    border-collapse: collapse;
    width: 100%;
    margin: 8px 0 12px;
    background: var(--panel);
    font-size: var(--fs-base);
    font-variant-numeric: tabular-nums;
}

.stat-table th, table.dbt th
{
    background: var(--blue-m);
    color: #fff;
    padding: 5px 6px;
    text-align: center;
    font: 700 var(--fs-md) var(--head);
}

.stat-table td, table.dbt td
{
    border-bottom: 1px solid var(--rule);
    padding: 4px 6px;
    text-align: center;
}

.stat-table tr > th:first-child
{
    background: var(--panel-2);
    color: var(--ink);
}

.stat-table tr:first-child > th:first-child
{
    background: var(--blue-m);
    color: #fff;
}

table.dbt tr:hover td
{
    background: var(--panel-2);
}

body.shell #wrapper .stat-table input
{
    width: 4em;
    text-align: center;
}

.stat-table .pill
{
    padding: 2px 10px 3px;
    font-size: var(--fs-sm);
}

.steps-row
{
    display: flex;
    gap: 8px;
    margin: 0 0 6px;
}

body.shell #wrapper .steps-row input
{
    width: 5em;
}

.shelf
{
    margin: 10px -12px -12px;
    padding: 6px 10px 10px;
    background: var(--panel-2) url("../img/ui/stripe.png") 0 0 / 128px;
    border-top: 3px solid var(--blue);
}

body.shell #wrapper .shelf-group
{
    margin: 8px 0 4px;
    font: 800 var(--fs-xs) var(--head);
    text-transform: uppercase;
    color: var(--link);
}

.shelf-grid
{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    justify-items: center;
    gap: 4px;
}

.shelf-item
{
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 4px 2px;
    border: 2px solid transparent;
    border-radius: var(--r-sm);
    background: var(--panel);
    color: var(--ink);
    font: 700 var(--fs-2xs)/1.2 var(--head);
    cursor: pointer;
}

.shelf-item img
{
    width: 40px;
    height: 40px;
}

.shelf-item:hover
{
    border-color: var(--blue);
}

.shelf-item.on
{
    border-color: var(--yellow);
    background: var(--hilite);
}

/* Save upload and the Yo-kai from the save */

.bar-row label.save-pick
{
    display: inline-block;
    color: var(--ink-on);
    font: 700 var(--fs-base) var(--head);
    text-transform: none;
    cursor: pointer;
}

.save-pick input
{
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.save-pick:focus-within
{
    outline: 2px solid var(--blue);
}

#box-panel
{
    max-width: var(--box-max);
    margin: 14px auto 0;
}

.box-grid
{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
    justify-items: center;
    gap: 4px;
}

.box-medal
{
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 4px 2px;
    border: 2px solid transparent;
    border-radius: var(--r-sm);
    background: var(--panel);
    color: var(--ink);
    font: 700 var(--fs-2xs)/1.2 var(--head);
    cursor: pointer;
}

.box-medal:hover
{
    border-color: var(--blue);
}

.box-medal img
{
    width: var(--medal);
    height: var(--medal);
}

/* Ladders */

.ladder-table
{
    max-width: 640px;
    margin: 0 auto;
}

/* Battle: Mt. Wildwood's battle simulator cards */

.field
{
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    border-radius: var(--r-xl);
    background: var(--panel) url("../img/ui/stripe.png") 0 0 / 128px;
}

body.shell #wrapper.dbpage .field h2
{
    margin: 0;
    font-size: var(--fs-6xl);
}

.yokai-row, .chip-row
{
    display: grid;
    grid-template-columns: repeat(3, var(--card-w));
    justify-content: center;
    gap: 10px;
}

.side-mine .chip-row
{
    margin-top: 14px;
}

.side-foe .chip-row
{
    margin-bottom: 14px;
}

.chip
{
    justify-self: center;
    width: var(--chip-w);
    min-height: 1px;
    padding: 2px 6px;
    border: 2px solid var(--blue-m);
    border-radius: var(--r-lg);
    background: var(--panel-a);
    font-size: var(--fs-sm);
    opacity: .7;
}

.chip:empty
{
    visibility: hidden;
}

.side-foe .chip
{
    border-color: var(--foe);
}

.chip .yokai-name
{
    margin: 2px 0;
    font-size: var(--fs-md);
}

.chip .hp
{
    height: calc(var(--hp-h) / 2);
    margin: 2px 0;
}

.chip.fainted
{
    opacity: .4;
}

.kit
{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 12px 0 0;
}

.kit-team h3
{
    margin: 0 0 6px;
    text-align: center;
}

.kit-list
{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.kit-card
{
    width: var(--kit-w);
    padding: 6px 8px;
    border: 2px solid var(--blue-m);
    border-radius: var(--r-lg);
    background: var(--panel-a);
    font-size: var(--fs-sm);
}

.kit-foe .kit-card
{
    border-color: var(--foe);
}

.kit-card.fainted
{
    opacity: .5;
}

.kit-card .yokai-name
{
    justify-content: flex-start;
    font-size: var(--fs-md);
}

.kit-line
{
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0;
}

.kit-icon
{
    flex: none;
    width: var(--kit-icon);
    height: var(--kit-icon);
}

.kit-skill
{
    margin-top: 6px;
    padding-top: 4px;
    border-top: 1px solid var(--panel-2);
}

.yokai
{
    padding: 6px 6px 8px;
    border: 2px solid var(--blue-m);
    border-radius: var(--r-lg);
    background: var(--panel-a);
    font-size: var(--fs-md);
}

.side-foe .yokai
{
    border-color: var(--foe);
}

.yokai.fainted
{
    opacity: .45;
}

.yokai.pinned
{
    box-shadow: 0 0 0 3px var(--pin);
}

.yokai.foe-target
{
    cursor: pointer;
}

.yokai.foe-target:hover
{
    border-color: var(--yellow);
}

.medal-big
{
    display: block;
    width: 100%;
    height: var(--render-h);
    object-fit: contain;
}

/* the frame fits every animation, so an idle Yo-kai stands in its lower middle with empty space above;
   the render runs past the card, the empty part over the border */
.yokai-render
{
    position: relative;
    display: block;
    width: var(--render);
    height: var(--render);
    margin: calc(var(--render) * -.22) calc((100% - var(--render)) / 2) calc(var(--render) * -.1);
}

.yokai-name
{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 4px 0;
    font: 400 var(--fs-xl) var(--title);
    color: var(--outline-fill);
    -webkit-text-stroke: 3px var(--outline-ink);
    paint-order: stroke fill;
    letter-spacing: .04em;
}

.medal
{
    width: var(--medal-s);
    height: var(--medal-s);
}

.badge
{
    width: var(--badge);
    height: var(--badge);
}

.hp
{
    height: var(--hp-h);
    margin: 4px 0;
    border-radius: var(--r-sm);
    background: var(--panel-2);
    overflow: hidden;
}

.hp-fill
{
    height: 100%;
    background: var(--hp);
}

.hp-fill.low
{
    background: var(--hp-low);
}

.hp-fill.crit
{
    background: var(--hp-crit);
}

.hp-fill.soul
{
    background: var(--soul);
}

.hp + .hp
{
    height: 8px;
}

.yokai .button-row
{
    margin: 6px 0 0;
    gap: 4px;
}

.yokai .pill
{
    padding: 3px 10px 4px;
    font-size: var(--fs-sm);
}

/* The YW1 3DS bottom screen, 320 x 240 game pixels, each one var(--bs) wide. Pieces are the game's own (build/sync_wheel.py),
   placed as measured from a 3DS capture. Slots sit clockwise from the top, --a is a slot's angle. */

.ds-bottom
{
    position: relative;
    width: calc(320 * var(--bs));
    height: calc(240 * var(--bs));
    margin: 12px auto 0;
    background: #000;
}

.ds-bottom img, .ds-bottom button
{
    position: absolute;
    display: block;
}

.ds-bottom > img
{
    pointer-events: none;
}

.ds-bottom button
{
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.ds-bottom button:disabled
{
    cursor: default;
}

.ds-bottom button img
{
    position: static;
    width: 100%;
    height: 100%;
}

.ds-fill
{
    left: calc(44 * var(--bs));
    top: calc(4 * var(--bs));
    width: calc(232 * var(--bs));
    height: calc(232 * var(--bs));
}

/* Faces and fainted sectors lie on the wheel, under the spokes, rings and lens, cut to the wheel's edge */
.ds-under
{
    position: absolute;
    inset: 0;
    clip-path: circle(calc(114 * var(--bs)) at 50% 50%);
}

.ds-frame
{
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

.ds-spokes
{
    left: calc(43 * var(--bs));
    top: calc(2.5 * var(--bs));
    width: calc(234 * var(--bs));
    height: calc(235 * var(--bs));
}

.ds-hub
{
    left: calc(129 * var(--bs));
    top: calc(88.5 * var(--bs));
    width: calc(62 * var(--bs));
    height: calc(63 * var(--bs));
}

.at-0 { --a: -60deg; }
.at-1 { --a: 0deg; }
.at-2 { --a: 60deg; }
.at-3 { --a: 120deg; }
.at-4 { --a: 180deg; }
.at-5 { --a: 240deg; }

.ds-arc
{
    left: calc(87.6 * var(--bs));
    top: calc(87.5 * var(--bs));
    width: calc(38 * var(--bs));
    height: calc(65 * var(--bs));
    transform-origin: calc(72.4 * var(--bs)) calc(32.5 * var(--bs));
    transform: rotate(calc(var(--a) + 90deg));
    filter: brightness(1.7) hue-rotate(-25deg) saturate(1.2);
}

.ds-out
{
    left: calc(102 * var(--bs));
    top: calc(4 * var(--bs));
    width: calc(116 * var(--bs));
    height: calc(57 * var(--bs));
    transform-origin: calc(58 * var(--bs)) calc(116 * var(--bs));
    transform: rotate(var(--a));
}

.ds-lens
{
    left: calc(110 * var(--bs));
    top: calc(70 * var(--bs));
    width: calc(100 * var(--bs));
    height: calc(100 * var(--bs));
}

.ds-arrow
{
    top: calc(100 * var(--bs));
    height: calc(43 * var(--bs));
}

.ds-l
{
    left: calc(119 * var(--bs));
    width: calc(19 * var(--bs));
}

.ds-r
{
    left: calc(177 * var(--bs));
    width: calc(21 * var(--bs));
}

.ds-arrow:disabled
{
    opacity: .4;
}

.ds-panel
{
    width: calc(95 * var(--bs));
    height: calc(119 * var(--bs));
}

.ds-soul, .ds-purify
{
    left: 0;
}

.ds-soul, .ds-target
{
    top: 0;
}

.ds-target
{
    right: 0;
}

.ds-purify
{
    bottom: 0;
}

.ds-bottom .ds-label
{
    position: absolute;
    width: auto;
    height: calc(19 * var(--bs));
}

.ds-soul .ds-label
{
    left: calc(9 * var(--bs));
    top: calc(12 * var(--bs));
}

.ds-target .ds-label
{
    right: calc(14 * var(--bs));
    top: calc(12 * var(--bs));
}

.ds-purify .ds-label
{
    left: calc(15 * var(--bs));
    bottom: calc(5 * var(--bs));
    height: calc(21 * var(--bs));
}

.ds-panel:disabled .ds-label
{
    filter: brightness(.55);
}

.ds-panel.on
{
    filter: brightness(1.2);
}

.ds-yokai
{
    left: calc((160 + 86 * sin(var(--a)) - 33) * var(--bs));
    top: calc((120 - 86 * cos(var(--a)) - 33) * var(--bs));
    width: calc(66 * var(--bs));
    height: calc(66 * var(--bs));
}

/* heads point at the hub, so the top slot is upside down */
.ds-bottom .ds-face
{
    transform: rotate(calc(var(--a) + 180deg));
}

.ds-yokai.fainted .ds-face
{
    opacity: .35;
}

.ds-yokai.pick
{
    filter: brightness(1.25);
}

.ds-bottom .ds-bubble
{
    left: calc((160 + 82 * sin(var(--a)) - 34.5) * var(--bs));
    top: calc((120 - 82 * cos(var(--a)) - 34) * var(--bs));
    width: calc(69 * var(--bs));
    height: calc(28 * var(--bs));
    pointer-events: none;
}

.ds-drop
{
    left: calc((160 + 106 * sin(var(--a) - 24deg) - 9) * var(--bs));
    top: calc((120 - 106 * cos(var(--a) - 24deg) - 12) * var(--bs));
    width: calc(18 * var(--bs));
    height: calc(24 * var(--bs));
    pointer-events: none;
}

.field.picking .foe-target
{
    border-color: var(--yellow);
}

.battle-log
{
    max-width: 760px;
    max-height: 360px;
    margin: 0 auto;
    padding: 8px 12px;
    overflow-y: auto;
    list-style: none;
    border: 2px solid var(--blue-m);
    border-radius: var(--r-xl);
    background: var(--panel);
    font-size: var(--fs-base);
}

.battle-log li
{
    padding: 2px 0;
    border-bottom: 1px solid var(--rule);
}

.battle-log .log-end
{
    color: var(--ink-gold);
    font-weight: 700;
}

/* Haunted Domain plug, Leafy's words (2026-10-19): bold white Arial, black outline */
.plug
{
    max-width: var(--sd-max);
    margin: 12px auto;
    padding: 0 16px;
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 700;
    color: #fff;
    -webkit-text-stroke: var(--plug-w) #000;
    paint-order: stroke fill;
}

.plug p
{
    margin: 0;
    font-size: var(--plug-t);
    line-height: 1.35;
}

.plug .plug-h
{
    margin: 0 0 6px;
    font-size: var(--plug-h);
    line-height: 1.15;
}

/* the early-days disclaimer under it, in red (Leafy 2026-10-19) */
.plug .plug-warn
{
    margin-top: 14px;
    color: var(--plug-red);
}

/* Approvals: one card per account, newest waiting first */

.approve-list
{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--approve-w), 1fr));
    gap: 10px;
}

.approve-card
{
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border: 2px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--panel);
}

.approve-name
{
    font: 800 var(--fs-lg) var(--head);
}

.approve-meta
{
    color: var(--mut);
    font-size: var(--fs-sm);
}

.approve-status
{
    font-weight: 700;
    color: var(--ink-gold);
}

.approve-card.s1 .approve-status
{
    color: var(--ink-green);
}

.approve-card.s-1 .approve-status
{
    color: var(--ink-red);
}

/* sign in and account headings in Arial, not Yuruka (Leafy 2026-10-19) */
body.shell #wrapper :is(#view-auth, #view-name, #view-wait, #view-admin, #view-privacy) :is(h1, h2)
{
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 700;
}

@media (max-width: 600px)
{
    .form label
    {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .slot-top
    {
        flex-direction: column;
    }

    .slot-main
    {
        width: 100%;
    }

    .yokai-row, .chip-row
    {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .chip
    {
        width: 100%;
    }

    .kit-card
    {
        width: 100%;
    }

    :root
    {
        --render-h: 100px;
        --render: 150px;
        --bs: calc((100vw - 32px) / 320);
        --plug-h: 26px;
        --plug-t: 16px;
        --plug-w: 4px;
    }
}

/* Privacy page: running text, so it reads left to right */
#view-privacy .pb
{
    text-align: left;
}

#view-privacy .pb a
{
    color: var(--link);
}
