/* destiny/style.css */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@300;400;600&family=EB+Garamond:ital,wght@0,400;0,500;1,400&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    height: 100%;
}

body {
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
    background: #f2f2f7;
    color: #1c1c1e;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

#c {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

/* ── Back nav ── */
.back-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 0.75rem 1.2rem;
    pointer-events: none;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(242, 242, 247, 0.82);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 999px;
    padding: 0.38rem 0.9rem 0.38rem 0.55rem;
    color: #1c1c1e;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background 0.2s;
    pointer-events: all;
}

.back-btn:hover {
    background: rgba(228, 228, 234, 0.9);
}

.back-arrow {
    font-size: 1.1rem;
    line-height: 1;
    color: #007aff;
    font-weight: 400;
}

.app {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 430px;
    padding: 72px 20px 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.badge {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #8e8e93;
    margin-bottom: 10px;
    text-align: center;
}

.hdr-zh {
    font-family: 'Noto Serif SC', serif;
    font-weight: 300;
    font-size: 3rem;
    letter-spacing: 8px;
    color: #1c1c1e;
    line-height: 1;
    text-align: center;
    margin-bottom: 8px;
}

.hdr-en {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 4px;
    color: #8e8e93;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 32px;
}

.card {
    width: 100%;
    background: #ffffff;
    border-radius: 22px;
    padding: 32px 24px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.07), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
}

.instruction {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-size: 1.15rem;
    color: #636366;
    text-align: center;
    line-height: 1.65;
    margin-bottom: 28px;
}

.digit-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 10px;
}

.dig {
    width: 48px;
    height: 62px;
    background: #f2f2f7;
    border: 1.5px solid transparent;
    border-radius: 14px;
    font-size: 1.6rem;
    font-weight: 300;
    text-align: center;
    color: #1c1c1e;
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
    caret-color: #007aff;
    padding: 0;
}

.dig:focus {
    border-color: #007aff;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
}

.dig.filled {
    background: #fff;
    border-color: #e5e5ea;
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

.dig-labels {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 8px;
}

.dig-lbl {
    width: 48px;
    text-align: center;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1px;
    color: #aeaeb2;
    text-transform: uppercase;
}

.format-hint {
    font-size: 12px;
    color: #aeaeb2;
    text-align: center;
    margin-bottom: 3px;
}

.format-eg {
    font-size: 11px;
    color: #c7c7cc;
    text-align: center;
    margin-bottom: 20px;
}

.err {
    font-size: 13px;
    color: #ff3b30;
    min-height: 18px;
    text-align: center;
    margin-bottom: 14px;
}

.btn-primary {
    width: 100%;
    padding: 17px;
    border-radius: 14px;
    border: none;
    background: #007aff;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.28);
}

.btn-primary:hover {
    background: #0070f0;
}

.btn-primary:active {
    transform: scale(0.975);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
}

.btn-ghost {
    width: 100%;
    padding: 15px;
    border-radius: 14px;
    border: 1.5px solid #e5e5ea;
    background: transparent;
    color: #007aff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.btn-ghost:hover {
    background: #f2f2f7;
}

.btn-ghost:active {
    transform: scale(0.975);
}

.results {
    width: 100%;
    display: none;
}

.results.show {
    display: block;
    animation: slideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.sec-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #aeaeb2;
    margin-bottom: 16px;
}

.z-top {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
}

.z-emoji-wrap {
    width: 76px;
    height: 76px;
    border-radius: 18px;
    background: linear-gradient(135deg, #fff8ee, #ffecd2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 2.6rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

.z-info {
    text-align: left;
}

.z-zh {
    font-family: 'Noto Serif SC', serif;
    font-weight: 400;
    font-size: 1.9rem;
    color: #1c1c1e;
    letter-spacing: 4px;
    line-height: 1;
    margin-bottom: 4px;
}

.z-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1c1c1e;
    margin-bottom: 3px;
}

.z-elem {
    font-size: 12px;
    color: #8e8e93;
    font-weight: 500;
}

.card-divider {
    height: 1px;
    background: #f2f2f7;
    margin: 16px 0;
}

.z-traits {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.z-trait {
    font-size: 12px;
    font-weight: 500;
    color: #3a3a3c;
    background: #f2f2f7;
    border-radius: 8px;
    padding: 6px 12px;
}

.n-top {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
}

.n-circle {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: linear-gradient(135deg, #eef4ff, #d8eaff);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(0, 122, 255, 0.1);
}

.n-num {
    font-size: 2.4rem;
    font-weight: 300;
    color: #007aff;
}

.n-info {
    text-align: left;
}

.n-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #007aff;
    background: #eef4ff;
    border-radius: 6px;
    padding: 4px 10px;
    margin-bottom: 6px;
}

.n-meaning {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1c1c1e;
}

.n-desc {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-size: 1.05rem;
    color: #636366;
    line-height: 1.72;
}

.footer {
    font-size: 11px;
    color: #c7c7cc;
    text-align: center;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 12px;
}
