/* Art of War Strategy Finder — 水墨 (ink-wash) treatment, sharing the series
   theme in assets/css/oriental.css. Rice paper, ink, one cinnabar accent.
   Class names are fixed by app.js. */

#aowsf { max-width: 760px; margin: 0 auto; color: var(--o-ink); }
#aowsf-app { transition: opacity .3s ease; opacity: 0; }

/* The entrance fade is a nice-to-have; being visible is not. #aowsf-app starts at
   opacity 0 and is revealed by a rAF callback in app.js — so a script error, or
   any context where rAF never fires, would leave the tool permanently blank.
   This animation forces the resting state visible after 1.2s; the reveal class
   cancels it, so a healthy load still gets the fade and nothing else changes. */
#aowsf-app { animation: aowsf-failsafe 0s linear 1.2s forwards; }
#aowsf-app.aowsf-in { animation: none; }
@keyframes aowsf-failsafe { to { opacity: 1; } }

#aowsf-app.aowsf-in { opacity: 1; }

/* ── Hero banner — ink-wash landscape, torn-paper bottom edge ───────────── */
.aowsf-hero-banner {
    position: relative;
    height: clamp(150px, 27vw, 230px);
    border-radius: 3px;
    margin-bottom: 1.5rem;
    background: var(--hero) center 38% / cover no-repeat, #14140f;
    box-shadow: inset 0 -70px 70px -34px rgba(20, 20, 15, .72), inset 0 0 0 1px rgba(242, 235, 218, .14);
}
/* a thin gold rule, like the silk mount on a scroll */
.aowsf-hero-banner::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--o-gold), transparent);
    opacity: .8;
}

/* ── Home ───────────────────────────────────────────────────────────────── */
.aowsf-hero-head { text-align: center; margin-bottom: 1.7rem; }
.aowsf-title {
    font-family: var(--o-serif);
    font-size: clamp(1.75rem, 5vw, 2.45rem);
    color: var(--o-ink);
    margin: 0 0 .5rem;
    line-height: 1.14;
}
.aowsf-title::after {
    content: '';
    display: block;
    width: 62px; height: 3px;
    margin: .75rem auto 0;
    background: linear-gradient(90deg, transparent, var(--o-seal), transparent);
    border-radius: 2px;
}
.aowsf-sub { color: var(--o-ink-soft); font-size: 1.02rem; line-height: 1.75; max-width: 48ch; margin: 0 auto; }

/* Two hanging scrolls — the two lenses */
.aowsf-modes { display: grid; gap: 1rem; }
@media (min-width: 620px) { .aowsf-modes { grid-template-columns: 1fr 1fr; } }
.aowsf-mode {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    min-height: 196px;
    padding: 1.6rem 1.35rem 1.3rem;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    border: 1px solid var(--o-line);
    border-radius: 2px;
    background-color: var(--o-paper);
    background-image:
        radial-gradient(120% 80% at 15% 0%, rgba(255, 253, 246, .92) 0%, rgba(255, 253, 246, 0) 60%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)' opacity='0.45'/%3E%3C/svg%3E");
    background-blend-mode: normal, multiply;
    box-shadow: inset 0 0 0 1px rgba(255, 253, 246, .6);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.aowsf-mode::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--o-gold), rgba(168, 135, 60, .3));
}
.aowsf-mode:hover {
    transform: translateY(-4px);
    border-color: var(--o-ink);
    box-shadow: inset 0 0 0 1px rgba(255, 253, 246, .6), 0 16px 34px rgba(22, 21, 15, .16);
}
.aowsf-mode-glyph { font-size: 2.15rem; line-height: 1; color: var(--o-seal); margin-bottom: .25rem; }
.aowsf-mode--strategist .aowsf-mode-glyph { color: var(--o-ink-2); }
.aowsf-mode-t { font-family: var(--o-serif); font-size: 1.38rem; color: var(--o-ink); line-height: 1.18; }
.aowsf-mode-s { font-size: .9rem; color: var(--o-ink-soft); line-height: 1.6; flex: 1; }
.aowsf-mode-go { font-family: var(--o-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--o-seal); }

/* ── Quiz ───────────────────────────────────────────────────────────────── */
.aowsf-quiz { max-width: 620px; margin: 0 auto; }
.aowsf-progress { height: 4px; background: rgba(22, 21, 15, .1); overflow: hidden; border-radius: 999px; }
.aowsf-progress-bar { height: 100%; background: linear-gradient(90deg, var(--o-ink-2), var(--o-seal)); transition: width .4s cubic-bezier(.3, .7, .3, 1); }
.aowsf-qmeta { font-family: var(--o-mono); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--o-ink-faint); margin: 1rem 0 .35rem; }
.aowsf-q { font-family: var(--o-serif); font-size: clamp(1.35rem, 4vw, 1.72rem); color: var(--o-ink); line-height: 1.32; margin: 0 0 1.2rem; }
.aowsf-opts { display: grid; gap: .6rem; }
.aowsf-opt {
    padding: .95rem 1.15rem;
    text-align: left;
    font-family: var(--o-serif);
    font-size: 1.02rem;
    color: var(--o-ink);
    background: rgba(255, 253, 246, .72);
    border: 1px solid var(--o-line);
    border-radius: 2px;
    min-height: 52px;
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .15s, box-shadow .15s;
}
.aowsf-opt:hover { border-color: var(--o-ink); background: #fffdf6; transform: translateX(3px); }
.aowsf-opt.on { border-color: var(--o-seal); background: rgba(157, 43, 37, .07); box-shadow: inset 3px 0 0 var(--o-seal); }
.aowsf-nav { margin-top: 1.2rem; }

/* ── Buttons — pressed ink ──────────────────────────────────────────────── */
.aowsf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: .7rem 1.3rem;
    font-family: var(--o-serif);
    font-size: .98rem;
    color: var(--o-paper);
    background: linear-gradient(160deg, var(--o-ink-2), var(--o-ink));
    border: 1px solid var(--o-ink);
    border-radius: 2px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 0 rgba(22, 21, 15, .25);
    transition: transform .15s, box-shadow .15s;
}
.aowsf-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 rgba(22, 21, 15, .2); }
.aowsf-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(22, 21, 15, .3); }
.aowsf-btn.ghost { background: transparent; color: var(--o-ink); border-color: var(--o-line); box-shadow: none; }
.aowsf-btn.ghost:hover { border-color: var(--o-ink); background: rgba(22, 21, 15, .04); }

/* ── Result ─────────────────────────────────────────────────────────────── */
.aowsf-result { animation: aowsf-bleed .5s cubic-bezier(.22, .68, .36, 1) both; }
@keyframes aowsf-bleed { from { opacity: 0; filter: blur(5px); transform: translateY(8px); } to { opacity: 1; filter: blur(0); transform: none; } }
.aowsf-r-label { font-family: var(--o-mono); font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--o-seal); margin-bottom: .6rem; }
.aowsf-r-label.sm { margin-top: 1.6rem; color: var(--o-ink-faint); }

/* stratagem cards */
.aowsf-strat {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding: 1.05rem 1.2rem;
    text-decoration: none;
    border: 1px solid var(--o-line);
    border-radius: 2px;
    background: rgba(255, 253, 246, .7);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.aowsf-strat:hover { border-color: var(--o-ink); box-shadow: 0 8px 20px rgba(22, 21, 15, .12); transform: translateY(-2px); }
/* the primary move gets the ink-wash slab */
.aowsf-strat.big {
    border: 0;
    padding: 1.9rem 1.6rem;
    color: var(--o-paper);
    background-color: #14140f;
    background-image:
        radial-gradient(130% 95% at 22% 0%, rgba(92, 96, 86, .5) 0%, rgba(20, 20, 15, 0) 60%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)' opacity='0.2'/%3E%3C/svg%3E");
    box-shadow: inset 0 0 0 10px rgba(242, 235, 218, .09);
}
.aowsf-strat.big:hover { transform: none; box-shadow: inset 0 0 0 10px rgba(242, 235, 218, .12); }
.aowsf-strat-hz { font-family: var(--o-han); font-weight: 700; color: var(--o-ink); font-size: 1.62rem; line-height: 1.15; letter-spacing: .07em; }
.aowsf-strat.big .aowsf-strat-hz { color: var(--o-paper); font-size: clamp(2.1rem, 8vw, 2.9rem); letter-spacing: .1em; }
.aowsf-strat-py { font-family: var(--o-serif); font-style: italic; font-size: .84rem; color: var(--o-ink-soft); }
.aowsf-strat.big .aowsf-strat-py { color: rgba(242, 235, 218, .6); font-size: 1rem; margin-top: .3rem; }
.aowsf-strat-lit { font-family: var(--o-serif); font-size: 1.05rem; color: var(--o-ink); }
.aowsf-strat.big .aowsf-strat-lit { color: var(--o-gold); font-size: 1.32rem; margin-top: .6rem; }
.aowsf-strat-gist { font-size: .95rem; color: rgba(242, 235, 218, .8); line-height: 1.7; margin-top: .55rem; }
.aowsf-strat-go { font-family: var(--o-mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--o-seal); margin-top: .6rem; }
.aowsf-strat.big .aowsf-strat-go { color: var(--o-gold); }
.aowsf-alts { display: grid; gap: .6rem; }
@media (min-width: 560px) { .aowsf-alts { grid-template-columns: 1fr 1fr; } }

.aowsf-why {
    margin-top: 1.3rem;
    padding: .95rem 1.15rem;
    background: rgba(168, 135, 60, .08);
    border-left: 3px solid var(--o-gold);
    font-size: .92rem;
    color: var(--o-ink-soft);
    line-height: 1.7;
}
.aowsf-why-h { font-family: var(--o-mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--o-ink); }

/* ── Strategist result ──────────────────────────────────────────────────── */
.aowsf-arch {
    display: flex;
    gap: 1.3rem;
    align-items: center;
    padding: 1.5rem;
    color: var(--o-paper);
    background-color: #14140f;
    background-image:
        radial-gradient(130% 95% at 20% 0%, rgba(92, 96, 86, .5) 0%, rgba(20, 20, 15, 0) 60%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)' opacity='0.2'/%3E%3C/svg%3E");
    border-radius: 3px;
    box-shadow: inset 0 0 0 10px rgba(242, 235, 218, .09);
}
/* round medallion with a gold ring — a scroll portrait 圆光 */
.aowsf-portrait {
    position: relative;
    flex: 0 0 auto;
    width: 108px; height: 108px;
    border-radius: 50%;
    overflow: hidden;
    background: #22221a;
    box-shadow: 0 0 0 2px rgba(168, 135, 60, .75), 0 0 0 7px rgba(242, 235, 218, .07);
}
.aowsf-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.aowsf-portrait-fb { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; font-family: var(--o-han); font-size: 2.1rem; font-weight: 700; color: var(--o-gold); }
.aowsf-portrait.noimg .aowsf-portrait-fb { display: flex; }
.aowsf-arch-name { font-family: var(--o-serif); font-size: 1.58rem; line-height: 1.12; }
.aowsf-arch-hz { font-family: var(--o-han); font-size: 1.12rem; color: var(--o-gold); margin-left: .35rem; letter-spacing: .06em; }
.aowsf-arch-ep { font-family: var(--o-serif); font-style: italic; color: rgba(242, 235, 218, .72); font-size: 1rem; margin-top: .3rem; }
.aowsf-tally { margin-top: .55rem; font-family: var(--o-mono); font-size: .72rem; letter-spacing: .06em; color: var(--o-gold); }
.aowsf-blurb { font-size: 1.05rem; line-height: 1.8; color: var(--o-ink); margin: 1.3rem 0; }
.aowsf-traits { display: grid; gap: .7rem; }
@media (min-width: 560px) { .aowsf-traits { grid-template-columns: 1fr 1fr; } }
.aowsf-trait { padding: .95rem 1.1rem; border: 1px solid var(--o-line-soft); border-radius: 2px; background: rgba(255, 253, 246, .6); }
.aowsf-trait .h { display: block; font-family: var(--o-mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--o-ink); margin-bottom: .4rem; }
.aowsf-trait p { margin: 0; font-size: .92rem; color: var(--o-ink-soft); line-height: 1.65; }
.aowsf-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.aowsf-chip {
    display: inline-flex;
    align-items: baseline;
    gap: .45rem;
    padding: .5rem .9rem;
    border: 1px solid var(--o-line);
    border-radius: 2px;
    background: rgba(255, 253, 246, .7);
    text-decoration: none;
    color: var(--o-ink);
    font-family: var(--o-han);
    font-weight: 700;
    letter-spacing: .05em;
    transition: border-color .15s, background .15s;
}
.aowsf-chip span { font-family: var(--o-serif); font-weight: 400; font-size: .82rem; color: var(--o-ink-soft); letter-spacing: 0; }
.aowsf-chip:hover { border-color: var(--o-ink); background: #fffdf6; }

.aowsf-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.6rem; }
.aowsf-err { color: var(--o-seal); text-align: center; padding: 2rem; }

/* toast */
.aowsf-flash {
    position: fixed; left: 50%; bottom: 24px;
    transform: translate(-50%, 20px);
    background: var(--o-ink); color: var(--o-paper);
    padding: .72rem 1.25rem; border-radius: 2px;
    font-family: var(--o-serif); font-size: .94rem;
    opacity: 0; transition: opacity .2s, transform .2s; z-index: 9999;
    box-shadow: 0 8px 24px rgba(22, 21, 15, .3);
}
.aowsf-flash.go { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { #aowsf-app, .aowsf-progress-bar, .aowsf-result { transition: none; animation: none; } }

/* ── Share Studio card (offscreen 1080×1350, exported to PNG) ───────────── */
.aowsf-sc-holder { position: absolute; left: -99999px; top: 0; width: 1080px; height: 1350px; overflow: hidden; pointer-events: none; }
.aowsf-sc { align-items: center; text-align: center; background: radial-gradient(120% 90% at 50% 0%, #24241c 0%, #14140f 62%); color: #f2ebda; }
.aowsf-sc .sc-eyebrow { font-family: ui-monospace, 'SFMono-Regular', monospace; font-size: 26px; letter-spacing: .18em; text-transform: uppercase; color: #a8873c; margin: 0 0 40px; }
.aowsf-sc-youare { font-size: 40px; color: rgba(242, 235, 218, .6); letter-spacing: .04em; margin-bottom: 26px; }
.aowsf-sc-portrait { width: 460px; height: 460px; border-radius: 50%; overflow: hidden; border: 8px solid rgba(168, 135, 60, .6); box-shadow: 0 24px 60px rgba(0, 0, 0, .45); margin-bottom: 44px; position: relative; background: #22221a; display: flex; align-items: center; justify-content: center; }
.aowsf-sc-portrait img { width: 100%; height: 100%; object-fit: cover; }
.aowsf-sc-pfb { position: absolute; font-family: 'Songti SC', 'SimSun', serif; font-size: 180px; font-weight: 800; color: rgba(242, 235, 218, .16); }
.aowsf-sc-name { font-family: 'DM Serif Display', Georgia, serif; font-size: 92px; line-height: 1.04; margin-bottom: 14px; }
.aowsf-sc-hz { font-family: 'Songti SC', 'SimSun', serif; font-size: 64px; font-weight: 800; color: #bf3a2b; margin-bottom: 20px; letter-spacing: .08em; }
.aowsf-sc-ep { font-size: 40px; color: rgba(242, 235, 218, .78); font-style: italic; margin-bottom: 34px; max-width: 820px; }
.aowsf-sc-sig { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.aowsf-sc-chip { font-size: 30px; color: #f2ebda; background: rgba(242, 235, 218, .08); border: 1px solid rgba(168, 135, 60, .45); padding: 14px 26px; border-radius: 999px; }
/* advisor variant */
.aowsf-sc--adv .aowsf-sc-strat-hz { font-family: 'Songti SC', 'SimSun', serif; font-size: 220px; font-weight: 800; line-height: 1; margin-bottom: 20px; letter-spacing: .08em; }
.aowsf-sc--adv .aowsf-sc-strat-py { font-size: 44px; color: #a8873c; margin-bottom: 30px; }
.aowsf-sc--adv .aowsf-sc-name { font-size: 76px; margin-bottom: 26px; }
.aowsf-sc--adv .aowsf-sc-gist { font-size: 38px; line-height: 1.5; color: rgba(242, 235, 218, .8); max-width: 860px; }
.aowsf-sc .sc-footer { margin-top: auto; }

/* mode-card plate — image last and small, per the card rule */
.aowsf-mode-plate {
    display: block;
    width: 100%;
    height: 92px;
    object-fit: cover;
    border-radius: 2px;
    margin-top: .9rem;
    border-top: 1px solid var(--o-line-soft);
    padding-top: .6rem;
}
