/* Personal Kurdish word notebook — post-level + map review */

.wn-overlay {
    position: fixed;
    inset: 0;
    z-index: 14000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: max(0.5rem, env(safe-area-inset-top)) max(0.5rem, env(safe-area-inset-right)) max(0.5rem, env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left));
    background: rgba(36, 18, 8, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.wn-overlay[hidden] {
    display: none !important;
}

.wn-sheet {
    position: relative;
    width: min(520px, 100%);
    max-height: min(92dvh, 860px);
    display: flex;
    flex-direction: column;
    border-radius: 1.6rem 1.6rem 1.1rem 1.1rem;
    background:
        linear-gradient(180deg, rgba(255, 248, 232, 0.97) 0%, rgba(255, 236, 200, 0.98) 100%);
    border: 2px solid rgba(201, 162, 39, 0.45);
    box-shadow:
        0 24px 60px rgba(40, 18, 6, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    color: #4a2c18;
    overflow: hidden;
    animation: wnSheetIn 0.38s cubic-bezier(0.2, 1.15, 0.35, 1);
}

@keyframes wnSheetIn {
    from { opacity: 0; transform: translateY(28px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.wn-header {
    flex: 0 0 auto;
    padding: 1rem 1.1rem 0.75rem;
    background:
        linear-gradient(135deg, #ffe08a 0%, #ffd24a 45%, #f0a020 100%);
    border-bottom: 2px solid rgba(255, 220, 120, 0.7);
    text-align: center;
}

.wn-kicker {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #7a4a12;
}

.wn-header h2 {
    margin: 0.15rem 0 0.15rem;
    font-size: clamp(1.15rem, 4.6vw, 1.45rem);
    font-weight: 900;
    color: #5c3824;
}

.wn-subtitle {
    margin: 0;
    font-size: 0.82rem;
    color: #7a4a18;
    font-weight: 600;
}

.wn-close {
    position: absolute;
    top: 0.7rem;
    inset-inline-start: 0.7rem;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.75);
    color: #5c3824;
    font-size: 1.35rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(80, 40, 10, 0.15);
    cursor: pointer;
}

.wn-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.9rem 0.85rem 1.1rem;
}

.wn-empty,
.wn-error,
.wn-loading {
    text-align: center;
    padding: 2rem 1rem;
    color: #8a5a38;
    font-weight: 700;
}

.wn-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 420px) {
    .wn-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.wn-card {
    display: flex;
    flex-direction: column;
    text-align: start;
    border: none;
    padding: 0;
    border-radius: 1.1rem;
    overflow: hidden;
    background: linear-gradient(180deg, #fffef9, #fff4e0);
    border: 1.5px solid rgba(201, 162, 39, 0.35);
    box-shadow: 0 8px 18px rgba(80, 40, 10, 0.1);
    color: inherit;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wn-card:hover,
.wn-card:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 12px 22px rgba(80, 40, 10, 0.16);
}

.wn-card-image {
    width: 100%;
    height: 110px;
    object-fit: cover;
    background: #f3e0c0;
    display: block;
}

.wn-card-body {
    padding: 0.7rem 0.75rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
}

.wn-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.4rem;
}

.wn-word {
    font-size: 1.2rem;
    font-weight: 900;
    color: #3d2414;
    line-height: 1.25;
}

.wn-hard {
    flex: 0 0 auto;
    font-size: 0.65rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ff8f6b, #e85d4c);
    color: #fff;
    border-radius: 999px;
    padding: 0.15rem 0.45rem;
    white-space: nowrap;
}

.wn-meaning {
    margin: 0;
    font-size: 0.86rem;
    font-weight: 700;
    color: #6d4224;
}

.wn-blurb {
    margin: 0;
    font-size: 0.78rem;
    color: #8a5a38;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wn-attempts {
    margin-top: 0.2rem;
    font-size: 0.75rem;
    font-weight: 800;
    color: #a06020;
}

.wn-footer {
    flex: 0 0 auto;
    display: flex;
    gap: 0.5rem;
    padding: 0.7rem 0.85rem 0.9rem;
    background: rgba(255, 248, 232, 0.9);
    border-top: 1px solid rgba(201, 162, 39, 0.28);
}

.wn-btn {
    flex: 1;
    min-height: 48px;
    border-radius: 999px;
    font-weight: 800;
    border: 1.5px solid rgba(230, 170, 90, 0.45);
    background: rgba(255, 255, 255, 0.8);
    color: #6d4224;
}

.wn-btn-primary {
    background: linear-gradient(135deg, #ffd24a, #f0a020);
    color: #5c3824;
    border-color: rgba(255, 220, 100, 0.7);
    box-shadow: 0 6px 16px rgba(200, 140, 40, 0.3);
}

.wn-detail {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #fffdf8, #ffe9c4);
    animation: wnSheetIn 0.28s ease;
}

.wn-detail[hidden] {
    display: none !important;
}

.wn-detail-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.9rem 1rem 1.2rem;
}

.wn-detail-image {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 1rem;
    margin-bottom: 0.85rem;
    border: 1.5px solid rgba(201, 162, 39, 0.35);
}

.wn-detail-word {
    font-size: clamp(1.6rem, 6vw, 2rem);
    font-weight: 900;
    text-align: center;
    margin: 0 0 0.35rem;
}

.wn-detail-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 0.9rem;
}

.wn-chip {
    font-size: 0.75rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(201, 162, 39, 0.35);
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
}

.wn-section {
    margin-bottom: 0.85rem;
}

.wn-section h3 {
    margin: 0 0 0.25rem;
    font-size: 0.78rem;
    font-weight: 800;
    color: #c09020;
}

.wn-section p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.65;
    color: #4a2c18;
}

.level-end-lexicon {
    flex: 1 1 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 46px;
    margin-bottom: 0.15rem;
    border-radius: 999px;
    font-weight: 800;
    background: linear-gradient(135deg, #fff8ee, #f0e0c8);
    color: #5c3824;
    border: 1.5px solid rgba(201, 162, 39, 0.5);
}

.km-node-lexicon {
    position: absolute;
    top: -6px;
    inset-inline-start: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(160deg, #fff6e0, #e8c56a);
    border: 1.5px solid #c9a227;
    color: #5c3824;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    z-index: 3;
    text-decoration: none;
    padding: 0;
    line-height: 1;
}

.km-node-lexicon:hover {
    transform: scale(1.12);
    color: #3d2414;
}
