/* Wróżka Iza — Tarot na Dziś v2.1 */

/* ========== FONTS (lokalnie, SIL OFL – bez Google Fonts) ========== */
@font-face {
    font-family: "TR Cinzel";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("fonts/cinzel-latin-ext-600-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "TR Cinzel";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("fonts/cinzel-latin-600-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "TR Crimson";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/crimson-text-latin-ext-400-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "TR Crimson";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/crimson-text-latin-400-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "TR Crimson";
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/crimson-text-latin-ext-400-italic.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "TR Crimson";
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/crimson-text-latin-400-italic.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "TR Crimson";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("fonts/crimson-text-latin-ext-600-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "TR Crimson";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("fonts/crimson-text-latin-600-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ========== TOKENS (wspólne z Tarot Tak Nie i Darmowym Tarotem) ========== */
.tnd-app {
    --tt-night: #141a33;
    --tt-ink: #1e2547;
    --tt-veil: rgba(243, 234, 215, 0.06);
    --tt-line: rgba(201, 164, 92, 0.35);
    --tt-gold: #c9a45c;
    --tt-gold-bright: #e6c88a;
    --tt-parchment: #f3ead7;
    --tt-muted: #b9b3c9;
    --tt-display: "TR Cinzel", Georgia, "Times New Roman", serif;
    --tt-serif: "TR Crimson", Georgia, "Times New Roman", serif;
    --tt-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --tt-ease: cubic-bezier(.2, .7, .2, 1);
    box-sizing: border-box;
}

.tnd-app {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 32px auto;
    padding: clamp(18px, 3.5vw, 40px);
    border-radius: 20px;
    border: 1px solid var(--tt-line);
    background:
        radial-gradient(120% 70% at 50% 0%, rgba(201, 164, 92, 0.12), transparent 60%),
        radial-gradient(90% 60% at 100% 100%, rgba(80, 96, 180, 0.22), transparent 70%),
        var(--tt-night);
    color: var(--tt-parchment);
    font-family: var(--tt-serif);
    font-size: 17px;
    line-height: 1.5;
    overflow: hidden;
    isolation: isolate;
}

.tnd-app *, .tnd-app *::before, .tnd-app *::after { box-sizing: border-box; }

.tnd-app [hidden] { display: none !important; }
.tnd-app p { margin: 0; padding: 0; }

.tnd-sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

.tnd-app button {
    font: inherit;
    color: inherit;
    margin: 0;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}

.tnd-app :focus-visible {
    outline: 2px solid var(--tt-gold-bright);
    outline-offset: 3px;
}

/* ========== HEADER ========== */
.tnd-app__head {
    text-align: center;
    max-width: 60ch;
    margin: 0 auto clamp(22px, 4vw, 32px);
}

.tnd-app .tnd-app__title {
    margin: 0 0 10px;
    padding: 0;
    font-family: var(--tt-display);
    font-size: clamp(1.35rem, 3.4vw, 2.05rem);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--tt-parchment);
    border: 0;
    background: none;
}

.tnd-app__lead {
    font-size: clamp(1rem, 2vw, 1.1rem);
    font-style: italic;
    color: var(--tt-muted);
}

.tnd-app__date {
    margin-top: 12px !important;
    font-family: var(--tt-sans);
    font-size: .78rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--tt-gold-bright);
}

.tnd-app__noscript {
    margin: 0 auto 20px !important;
    max-width: 60ch;
    padding: 12px 16px !important;
    border: 1px solid var(--tt-line);
    border-radius: 10px;
    text-align: center;
}

/* ========== STAGE ========== */
.tnd-stage {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: clamp(24px, 4vw, 48px);
}

.tnd-app.is-drawn .tnd-stage {
    grid-template-columns: auto minmax(0, 60ch);
    justify-content: center;
    justify-items: stretch;
    align-items: start;
}

.tnd-stage__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.tnd-app .tnd-card {
    display: block;
    width: 240px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    perspective: 1200px;
    border-radius: 14px;
}

.tnd-app.is-drawn .tnd-card { cursor: default; }

.tnd-card__inner {
    position: relative;
    display: block;
    aspect-ratio: 300 / 527;
    transform-style: preserve-3d;
    transition: transform .8s var(--tt-ease);
}

.tnd-app.is-flipped .tnd-card__inner { transform: rotateY(180deg); }

.tnd-card__face {
    position: absolute;
    inset: 0;
    display: block;
    border-radius: 12px;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border: 1px solid var(--tt-gold);
    background: var(--tt-ink);
    box-shadow: 0 22px 44px -20px rgba(0, 0, 0, .8);
}

.tnd-card__face--front { transform: rotateY(180deg); }

.tnd-card__face img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    border-radius: 0;
    object-fit: cover;
}

/* Oczekiwanie: delikatna poświata zachęcająca do kliknięcia */
.tnd-app:not(.is-drawn) .tnd-card__face--back {
    animation: tndGlow 2.8s ease-in-out infinite;
}

@media (hover: hover) {
    .tnd-app:not(.is-drawn) .tnd-card:hover .tnd-card__inner { transform: translateY(-8px); }
}

@keyframes tndGlow {
    0%, 100% { box-shadow: 0 22px 44px -20px rgba(0, 0, 0, .8), 0 0 0 0 rgba(230, 200, 138, 0); }
    50%      { box-shadow: 0 22px 44px -20px rgba(0, 0, 0, .8), 0 0 28px 2px rgba(230, 200, 138, .35); }
}

.tnd-hint {
    font-size: 1.05rem;
    font-style: italic;
    color: var(--tt-gold-bright);
    text-align: center;
}

.tnd-app.is-drawn .tnd-hint { display: none; }

/* ========== RESULT ========== */
.tnd-result {
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: tndFade .6s .35s var(--tt-ease) both;
}

.tnd-result__shared {
    font-family: var(--tt-sans);
    font-size: .88rem;
    padding: 10px 14px !important;
    border-left: 2px solid var(--tt-gold);
    background: rgba(201, 164, 92, 0.08);
    border-radius: 0 8px 8px 0;
}

.tnd-result__arcana {
    font-family: var(--tt-sans);
    font-size: .75rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--tt-muted);
}

.tnd-result__name {
    margin-top: -8px !important;
    font-family: var(--tt-display);
    font-size: clamp(1.45rem, 3vw, 1.95rem);
    font-weight: 600;
    line-height: 1.2;
    color: var(--tt-parchment);
}

.tnd-result__name-sub {
    display: block;
    margin-top: 2px;
    font-family: var(--tt-serif);
    font-size: .95rem;
    font-weight: 400;
    font-style: italic;
    color: var(--tt-muted);
}

.tnd-result__name-sub:empty { display: none; }

.tnd-result__meaning {
    padding: 14px 0 !important;
    border-top: 1px solid var(--tt-line);
    border-bottom: 1px solid var(--tt-line);
    font-size: 1.15rem;
    line-height: 1.65;
}

.tnd-aspects {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.tnd-aspect {
    padding: 14px;
    border-radius: 12px;
    background: var(--tt-veil);
    border: 1px solid rgba(243, 234, 215, 0.08);
}

.tnd-aspect--advice {
    border-color: var(--tt-line);
    background: linear-gradient(135deg, rgba(201, 164, 92, 0.12), rgba(201, 164, 92, 0.03));
}

.tnd-aspect__label {
    margin-bottom: 6px !important;
    font-family: var(--tt-display);
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .05em;
    color: var(--tt-gold-bright);
}

.tnd-aspect__text {
    font-size: 1rem;
    line-height: 1.5;
}

.tnd-result__actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 4px;
}

.tnd-app .tnd-again {
    padding: 11px 26px;
    border-radius: 999px;
    border: 1px solid var(--tt-gold);
    background: transparent;
    color: var(--tt-gold-bright);
    font-family: var(--tt-sans);
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .2s, color .2s;
}

.tnd-app .tnd-again:hover {
    background: var(--tt-gold);
    color: var(--tt-night);
}

/* ========== SHARE + CTA ========== */
.tnd-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    font-family: var(--tt-sans);
}

.tnd-share__title {
    font-size: .85rem;
    color: var(--tt-muted);
}

.tnd-share__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tnd-app .tnd-share__btn {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 13px;
    border: 1px solid rgba(243, 234, 215, 0.2);
    border-radius: 999px;
    background: transparent;
    color: var(--tt-parchment);
    font-family: var(--tt-sans);
    font-size: .82rem;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: border-color .2s, color .2s;
}

.tnd-app .tnd-share__btn:hover {
    border-color: var(--tt-gold);
    color: var(--tt-gold-bright);
}

.tnd-app .tnd-share__btn--native {
    background: var(--tt-parchment);
    border-color: var(--tt-parchment);
    color: var(--tt-night);
}

.tnd-app .tnd-share__btn.is-done {
    border-color: #7ab38b;
    color: #7ab38b;
}

.tnd-cta {
    margin-top: 6px;
    padding: 18px 20px;
    border-radius: 12px;
    border: 1px solid var(--tt-line);
    background: linear-gradient(135deg, rgba(201, 164, 92, 0.14), rgba(201, 164, 92, 0.03));
}

.tnd-cta__title {
    font-family: var(--tt-display);
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--tt-gold-bright);
    margin-bottom: 6px !important;
}

.tnd-cta__text {
    font-size: 1.02rem;
    line-height: 1.55;
    color: var(--tt-muted);
    margin-bottom: 14px !important;
}

.tnd-app .tnd-cta__btn {
    display: inline-block;
    padding: 11px 22px;
    border-radius: 999px;
    background: var(--tt-gold);
    color: var(--tt-night);
    font-family: var(--tt-sans);
    font-size: .92rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .2s;
}

.tnd-app .tnd-cta__btn:hover,
.tnd-app .tnd-cta__btn:focus-visible {
    background: var(--tt-gold-bright);
    color: var(--tt-night);
}

/* ========== ANIMATIONS ========== */
@keyframes tndFade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 820px) {
    .tnd-app.is-drawn .tnd-stage {
        grid-template-columns: 1fr;
        justify-items: center;
    }
    .tnd-result { width: 100%; }
    .tnd-aspects { grid-template-columns: 1fr; }
    .tnd-result__arcana,
    .tnd-result__name { text-align: center; }
    .tnd-result__actions,
    .tnd-share { justify-content: center; }
    .tnd-share__buttons { justify-content: center; }
    .tnd-share__title { width: 100%; text-align: center; }
    .tnd-cta { text-align: center; }
}

@media (max-width: 720px) {
    .tnd-app {
        font-size: 16px;
        border-radius: 16px;
    }
    .tnd-app { margin: 20px auto; }
    .tnd-app .tnd-card { width: min(220px, 62vw); }
    .tnd-app.is-drawn .tnd-card { width: min(180px, 50vw); }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
    .tnd-app *, .tnd-app *::before, .tnd-app *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
