/**
 * Les Pierres de la Paix - PWA Stylesheet
 * Light / luminous theme — peace, warmth, spiritual
 */

/* ── CSS Variables ───────────────────────────────────────────── */

:root {
    --bg-primary: #f9f6f0;
    --bg-secondary: #ffffff;
    --bg-card: #fffdf8;
    --bg-nav: rgba(255, 253, 248, 0.92);

    --gold-dark: #8B6914;
    --gold: #DAA520;
    --gold-light: #F0D060;
    --gold-pale: #FDF5DC;
    --gold-glow: rgba(218, 165, 32, 0.25);

    --text-primary: #2C2418;
    --text-secondary: #6B5D4F;
    --text-muted: #9B8E7E;
    --text-on-gold: #3A2800;

    --border-light: #E8E0D4;
    --border-medium: #D4C9B8;

    --repos-bg: #F0EAF5;
    --repos-text: #6B4C8A;
    --repos-border: #D8C8E8;

    --alerte-bg: #FFF3E8;
    --alerte-text: #8B5E2A;
    --alerte-border: #F0D8B8;

    --error: #C0392B;

    --shadow-sm: 0 1px 3px rgba(44, 36, 24, 0.06);
    --shadow-md: 0 4px 12px rgba(44, 36, 24, 0.08);
    --shadow-lg: 0 8px 24px rgba(44, 36, 24, 0.10);
    --shadow-gold: 0 4px 20px rgba(218, 165, 32, 0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --font-serif: Georgia, "Times New Roman", serif;
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    --nav-height: 64px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Reset & Base ─────────────────────────────────────────────── */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100%;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--gold-dark);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--gold);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ── Typography ──────────────────────────────────────────────── */

h1, h2, h3 {
    font-family: var(--font-serif);
    font-weight: 700;
    color: var(--gold-dark);
    line-height: 1.3;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

.label-sm {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

/* ── Views ────────────────────────────────────────────────────── */

.pdp-view {
    display: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    position: absolute;
    width: 100%;
    pointer-events: none;
}

.pdp-view.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    position: relative;
    pointer-events: auto;
}

.view-content {
    max-width: 500px;
    margin: 0 auto;
    padding: 24px 20px calc(var(--nav-height) + var(--safe-bottom) + 24px);
}

.view-content > h2 {
    font-family: var(--font-serif);
    color: var(--gold-dark);
    font-size: 1.5rem;
    margin-bottom: 24px;
    text-align: center;
}

/* ── Login ────────────────────────────────────────────────────── */

#view-login {
    display: none;
    height: 100vh;
    height: 100dvh;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #fffdf8 0%, #f5efe4 50%, #f0e8d8 100%);
}

#view-login.active {
    display: flex;
}

.login-container {
    width: 100%;
    max-width: 360px;
    padding: 32px 24px;
    text-align: center;
}

.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-pale) 0%, #fff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    box-shadow: var(--shadow-gold);
    border: 2px solid var(--gold-light);
}

.login-title {
    font-family: var(--font-serif);
    color: var(--gold-dark);
    font-size: 1.65rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 400;
    margin-bottom: 36px;
    letter-spacing: 0.02em;
}

.login-container label {
    display: block;
    text-align: left;
    margin-bottom: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.login-container input[type="tel"] {
    width: 100%;
    padding: 18px 16px;
    font-size: 2rem;
    text-align: center;
    letter-spacing: 0.5em;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: none;
    border-bottom: 2px solid var(--border-medium);
    border-radius: 0;
    outline: none;
    transition: border-color 0.3s;
    font-family: var(--font-serif);
}

.login-container input[type="tel"]::placeholder {
    color: var(--border-medium);
}

.login-container input[type="tel"]:focus {
    border-bottom-color: var(--gold);
}

.btn-gold {
    display: block;
    width: 100%;
    margin-top: 20px;
    padding: 15px 24px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-on-gold);
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: var(--shadow-gold);
    letter-spacing: 0.02em;
}

.btn-gold:hover {
    box-shadow: 0 6px 24px rgba(218, 165, 32, 0.3);
    transform: translateY(-1px);
}

.btn-gold:active {
    transform: scale(0.97) translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-gold:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}

.error-msg {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 14px;
    padding: 10px 14px;
    background: #FDF0EF;
    border-radius: var(--radius-sm);
    border: 1px solid #F5D5D2;
}

.login-links {
    display: flex;
    justify-content: space-between;
    margin-top: 28px;
    font-size: 0.85rem;
}

.login-links a {
    color: var(--text-muted);
    transition: color 0.2s;
}

.login-links a:hover {
    color: var(--gold-dark);
}

/* ── Stone Photo (Accueil) ────────────────────────────────────── */

.stone-photo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    padding-top: 8px;
}

.stone-photo {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 3px solid var(--gold);
    box-shadow: 0 0 0 6px var(--gold-pale), var(--shadow-gold);
    object-fit: cover;
    transition: all 0.5s ease;
}

.stone-photo-wrap.repos .stone-photo {
    filter: sepia(0.3) saturate(0.7);
    box-shadow: 0 0 0 6px var(--repos-bg), 0 0 20px rgba(107, 76, 138, 0.15);
    border-color: var(--repos-border);
}

.stone-name {
    font-family: var(--font-serif);
    color: var(--gold-dark);
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2px;
}

.stone-ange {
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.95rem;
    margin-bottom: 4px;
    font-style: italic;
}

.stone-hebrew {
    text-align: center;
    font-size: 1.6rem;
    color: var(--gold);
    margin-bottom: 12px;
    line-height: 1;
}

.stone-description {
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.7;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Banners ──────────────────────────────────────────────────── */

.repos-banner {
    background: var(--repos-bg);
    color: var(--repos-text);
    text-align: center;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 0.9rem;
    border: 1px solid var(--repos-border);
    line-height: 1.5;
}

.alerte-banner {
    background: var(--alerte-bg);
    color: var(--alerte-text);
    text-align: center;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 0.9rem;
    border: 1px solid var(--alerte-border);
    line-height: 1.5;
}

/* ── Action Grid ──────────────────────────────────────────────── */

.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 20px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 14px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gold-dark);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: var(--shadow-sm);
}

.action-btn:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gold-light);
    transform: translateY(-2px);
}

.action-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.action-btn .action-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.action-btn .action-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ── Bottom Nav ───────────────────────────────────────────────── */

#pdp-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--bg-nav);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-light);
    padding: 6px 0 2px;
    padding-bottom: calc(6px + var(--safe-bottom));
    height: calc(var(--nav-height) + var(--safe-bottom));
    z-index: 100;
}

#pdp-nav[hidden] {
    display: none;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 18px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.nav-btn::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 28px;
    height: 3px;
    background: var(--gold);
    border-radius: 0 0 3px 3px;
    transition: transform 0.25s ease;
}

.nav-btn.active {
    color: var(--gold-dark);
}

.nav-btn.active::after {
    transform: translateX(-50%) scaleX(1);
}

.nav-btn:hover {
    color: var(--gold-dark);
}

.nav-icon {
    font-size: 1.35rem;
    line-height: 1;
}

.nav-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Forms (general) ──────────────────────────────────────────── */

label {
    display: block;
    margin-bottom: 6px;
    margin-top: 16px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px 4px;
    font-size: 1rem;
    font-family: var(--font-sans);
    background: transparent;
    color: var(--text-primary);
    border: none;
    border-bottom: 2px solid var(--border-light);
    border-radius: 0;
    outline: none;
    transition: border-color 0.3s;
}

input:focus,
textarea:focus,
select:focus {
    border-bottom-color: var(--gold);
}

input::placeholder,
textarea::placeholder {
    color: var(--border-medium);
}

textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 12px;
    background: var(--bg-secondary);
}

textarea:focus {
    border-color: var(--gold);
    border-bottom-color: var(--gold);
}

select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239B8E7E' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    padding-right: 24px;
    cursor: pointer;
}

/* ── Buttons (general) ────────────────────────────────────────── */

button {
    font-family: inherit;
}

.btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gold-dark);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    border-color: var(--gold-light);
    box-shadow: var(--shadow-md);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    margin-bottom: 16px;
}

.back-btn:hover {
    color: var(--gold-dark);
}

/* ── Cards / Lists ───────────────────────────────────────────── */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s, transform 0.25s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.card-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card-body {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ── Tirage ──────────────────────────────────────────────────── */

.tirage-choices {
    text-align: center;
    padding-top: 16px;
}

.tirage-choices h2 {
    font-family: var(--font-serif);
    color: var(--gold-dark);
    margin-bottom: 4px;
}

.tirage-choices .subtitle,
.tirage-sort .subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

.tirage-choice-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 22px 20px;
    margin-bottom: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.tirage-choice-btn:hover {
    border-color: var(--gold-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.tirage-choice-btn:active {
    transform: translateY(0);
}

.choice-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    line-height: 1;
}

.choice-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold-dark);
    margin-bottom: 4px;
}

.choice-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.tirage-back {
    margin-top: 28px;
}

.tirage-back a {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.tirage-back a:hover {
    color: var(--gold-dark);
}

/* ── Tirage Cards (Hebrew) ────────────────────────────────────── */

.tirage-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
    margin-bottom: 28px;
}

.tirage-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 8px;
    background: linear-gradient(160deg, #FFFDF8 0%, #F8F2E4 100%);
    border: 2px solid var(--gold-pale);
    border-radius: var(--radius-md);
    cursor: default;
    transition: all 0.4s ease;
    box-shadow: var(--shadow-sm);
    min-height: 100px;
    position: relative;
    overflow: hidden;
}

.tirage-card::before {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1px solid var(--gold-pale);
    border-radius: calc(var(--radius-md) - 3px);
    pointer-events: none;
}

.tirage-card .hebrew {
    font-size: 1.8rem;
    color: var(--gold-dark);
    line-height: 1;
    margin-bottom: 6px;
}

.tirage-card .card-name {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tirage-card.selected {
    border-color: var(--gold);
    box-shadow: var(--shadow-gold);
    transform: scale(1.05);
}

/* ── Tirage Reveal ────────────────────────────────────────────── */

.tirage-reveal {
    text-align: center;
    padding: 32px 0 24px;
    animation: revealFade 0.8s ease forwards;
}

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

.tirage-reveal h2 {
    font-family: var(--font-serif);
    color: var(--gold-dark);
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.reveal-ange {
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 4px;
}

.reveal-lettre {
    font-size: 1.6rem;
    color: var(--gold);
    margin-bottom: 24px;
}

.reveal-code {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: 20px 0;
    box-shadow: var(--shadow-md);
}

.reveal-code p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.code-display {
    font-family: var(--font-serif);
    font-size: 2.4rem;
    color: var(--gold-dark);
    letter-spacing: 0.3em;
}

.reveal-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 16px;
    line-height: 1.5;
}

/* ── Tirage Done ──────────────────────────────────────────────── */

.tirage-done {
    text-align: center;
    padding: 40px 0 24px;
}

.tirage-done h2 {
    font-family: var(--font-serif);
    color: var(--gold-dark);
    margin-bottom: 8px;
}

.tirage-done p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ── Tirage Claim / Sort forms ────────────────────────────────── */

.tirage-claim,
.tirage-sort {
    padding-top: 8px;
}

.tirage-claim h2,
.tirage-sort h2 {
    text-align: center;
    margin-bottom: 4px;
}

/* ── Loading ──────────────────────────────────────────────────── */

.loading {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 0;
    font-style: italic;
}

/* ── Utilities ────────────────────────────────────────────────── */

.text-center { text-align: center; }
.text-gold { color: var(--gold-dark); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

/* ── Responsive ───────────────────────────────────────────────── */

@media (min-width: 520px) {
    .view-content {
        padding: 32px 24px calc(var(--nav-height) + var(--safe-bottom) + 32px);
    }

    .stone-photo {
        width: 220px;
        height: 220px;
    }

    .action-grid {
        gap: 16px;
    }

    .login-container {
        padding: 40px 32px;
    }
}

@media (min-width: 768px) {
    .view-content {
        max-width: 560px;
        padding: 40px 32px calc(var(--nav-height) + var(--safe-bottom) + 40px);
    }

    .stone-photo {
        width: 240px;
        height: 240px;
    }

    .tirage-cards {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 12px;
    }
}

/* ── iPad tablet (portrait and landscape) ────────────────────── */

@media (min-width: 768px) and (max-width: 1024px) {
    .view-content {
        max-width: 600px;
        margin: 0 auto;
    }

    .action-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ── iPhone SE small screen ──────────────────────────────────── */

@media (max-width: 374px) {
    .stone-photo {
        width: 140px;
        height: 140px;
    }

    .login-title {
        font-size: 1.4rem;
    }

    .action-grid {
        gap: 10px;
    }

    .action-btn {
        padding: 16px 10px;
    }

    .nav-btn {
        padding: 6px 12px;
    }
}

/* ── Print (hide nav) ────────────────────────────────────────── */

@media print {
    #pdp-nav { display: none; }
    .view-content { padding-bottom: 24px; }
}

/* ── Journal Module ──────────────────────────────────────────── */

.journal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.journal-header h2 {
    margin-bottom: 0;
}

.journal-export-wrap {
    position: relative;
}

.journal-export-toggle {
    padding: 8px 14px;
    font-size: 0.85rem;
}

.journal-export-menu {
    position: absolute;
    top: 42px;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 210px;
    z-index: 50;
    overflow: hidden;
}

.journal-export-menu button,
.journal-import-label {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.journal-export-menu button:hover,
.journal-import-label:hover {
    background: var(--gold-pale);
    color: var(--gold-dark);
}

.journal-export-menu hr {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 0;
}

.journal-new-btn {
    margin-bottom: 16px;
}

/* ── Journal Filters ─────────────────────────────────────────── */

.journal-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.journal-filter-input {
    flex: 1;
    min-width: 100px;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.journal-filter-select {
    flex: 1;
    min-width: 120px;
    padding: 8px;
    font-size: 0.85rem;
}

.journal-sort-btn {
    padding: 8px 12px;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    white-space: nowrap;
    font-family: inherit;
    transition: border-color 0.2s;
}

.journal-sort-btn:hover {
    border-color: var(--gold);
}

/* ── Journal Entry Cards ─────────────────────────────────────── */

.journal-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.journal-entry-card {
    display: flex;
    align-items: stretch;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-sm);
}

.journal-entry-card:hover {
    border-color: var(--gold-light);
    box-shadow: var(--shadow-md);
}

.entry-emotion-bar {
    width: 6px;
    flex-shrink: 0;
}

.entry-content {
    flex: 1;
    padding: 12px 14px;
    min-width: 0;
}

.entry-date {
    font-size: 0.85rem;
    font-family: var(--font-serif);
    color: var(--gold-dark);
    margin-bottom: 2px;
}

.entry-emotion-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 4px;
}

.entry-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entry-badges {
    display: flex;
    gap: 6px;
}

.badge-public {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.7rem;
    border-radius: 6px;
    background: var(--gold-pale);
    color: var(--gold-dark);
    font-weight: 600;
}

.badge-private {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.7rem;
    border-radius: 6px;
    background: var(--repos-bg);
    color: var(--repos-text);
    font-weight: 600;
}

.entry-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    flex-shrink: 0;
    background: none;
    border: none;
    border-left: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.entry-delete-btn:hover {
    color: var(--error);
    background: rgba(192, 57, 43, 0.06);
}

.journal-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 0;
    font-size: 0.95rem;
}

/* ── Journal Editor ──────────────────────────────────────────── */

.btn-back {
    display: inline-block;
    padding: 8px 0;
    background: none;
    border: none;
    color: var(--gold-dark);
    font-size: 0.95rem;
    cursor: pointer;
    margin-bottom: 12px;
    font-family: inherit;
    transition: color 0.2s;
}

.btn-back:hover {
    color: var(--gold);
}

.editor-title {
    text-align: left;
    font-size: 1.3rem;
    margin-bottom: 16px;
}

.editor-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    margin-top: 14px;
}

.editor-date {
    padding: 10px 12px;
    margin-bottom: 4px;
}

.editor-textarea {
    min-height: 200px;
    transition: background-color 0.3s, color 0.3s;
}

.editor-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.editor-toggle input[type="checkbox"] {
    width: auto;
    accent-color: var(--gold);
}

.btn-danger {
    display: block;
    width: 100%;
    padding: 12px;
    background: rgba(192, 57, 43, 0.06);
    color: var(--error);
    border: 1px solid rgba(192, 57, 43, 0.2);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: rgba(192, 57, 43, 0.12);
}

/* ── Emotion Dropdown (Plutchik style) ───────────────────────── */

.emotion-dropdown {
    position: relative;
    margin-bottom: 4px;
}

.emotion-dropdown-selected {
    padding: 12px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s, border-color 0.2s;
}

.emotion-dropdown-selected:hover {
    border-color: var(--gold);
}

.emotion-dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    max-height: 280px;
    overflow-y: auto;
}

.emotion-option {
    padding: 11px 14px;
    cursor: pointer;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    transition: opacity 0.2s;
}

.emotion-option:hover {
    opacity: 0.85;
}

.emotion-option:last-child {
    border-bottom: none;
}

.emotion-option-none {
    background: var(--bg-card);
    color: var(--text-secondary);
}

/* ============================================================
   MEDITATION
   ============================================================ */

.meditation-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    gap: 20px;
}

.meditation-canvas-wrap {
    position: relative;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 1;
    border-radius: 16px;
    overflow: hidden;
    background: #0a0a12;
}

#meditation-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.meditation-stone-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease;
}

.meditation-stone-img {
    width: 60%;
    height: 60%;
    object-fit: contain;
    border-radius: 50%;
    filter: drop-shadow(0 0 20px rgba(255,215,0,0.4));
}

.meditation-zscore {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.z-value {
    font-family: 'Georgia', serif;
    font-size: 2.5rem;
    font-weight: bold;
    color: #00CC66;
    transition: color 0.5s ease;
}

.z-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted, #999);
}

.meditation-sources {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.source-indicator {
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--bg-card, #fff);
    border: 1px solid rgba(0,0,0,0.08);
    color: var(--text-secondary, #666);
    transition: opacity 0.3s;
}

.source-indicator.active {
    border-color: #00CC66;
    color: #00CC66;
}

.meditation-theme {
    text-align: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(218,165,32,0.08), rgba(218,165,32,0.02));
    border: 1px solid rgba(218,165,32,0.15);
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
}

.theme-ange {
    display: block;
    font-family: 'Georgia', serif;
    font-size: 1rem;
    color: var(--accent, #8B6914);
    margin-bottom: 4px;
}

.theme-text {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary, #666);
    font-style: italic;
}

.meditation-scale {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
}

.meditation-scale select {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    background: var(--bg-card, #fff);
    font-size: 0.85rem;
    color: var(--text-primary, #333);
}

.meditation-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 420px;
}

.btn-meditation {
    flex: 1;
    min-width: 110px;
    padding: 12px 16px;
    border: 1px solid rgba(139,105,20,0.2);
    border-radius: 12px;
    background: var(--bg-card, #fff);
    color: var(--accent, #8B6914);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-align: center;
}

.btn-meditation:hover {
    background: rgba(218,165,32,0.08);
}

.btn-meditation:active {
    transform: scale(0.97);
}

.btn-meditation.active {
    background: var(--accent, #8B6914);
    color: #fff;
    border-color: var(--accent, #8B6914);
}

.meditation-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.overlay-content {
    background: var(--bg-card, #fff);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    max-width: 320px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.overlay-content p {
    margin: 0 0 16px;
    font-size: 0.95rem;
    color: var(--text-primary, #333);
}

.meditation-fallback {
    text-align: center;
    padding: 40px;
    color: var(--text-muted, #999);
    font-style: italic;
}

/* ============================================================
   TIRAGE
   ============================================================ */

.tirage-choices {
    text-align: center;
    padding: 20px 0;
}

.tirage-choices h2 {
    font-family: 'Georgia', serif;
    color: var(--accent, #8B6914);
    margin-bottom: 8px;
}

.tirage-choices .subtitle {
    color: var(--text-secondary, #666);
    margin-bottom: 24px;
}

.tirage-choice-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 16px 20px;
    margin-bottom: 12px;
    background: var(--bg-card, #fff);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 14px;
    cursor: pointer;
    text-align: left;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.tirage-choice-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.choice-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.choice-title {
    display: block;
    font-weight: 600;
    color: var(--text-primary, #333);
    font-size: 1rem;
    margin-bottom: 2px;
}

.choice-desc {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary, #666);
}

.tirage-back {
    margin-top: 20px;
}

.tirage-back a {
    color: var(--accent, #8B6914);
    font-size: 0.9rem;
}

.back-btn {
    background: none;
    border: none;
    color: var(--accent, #8B6914);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 16px;
}

.tirage-claim, .tirage-sort {
    padding: 10px 0;
}

.tirage-claim h2, .tirage-sort h2 {
    font-family: 'Georgia', serif;
    color: var(--accent, #8B6914);
    margin-bottom: 16px;
}

.tirage-claim label, .tirage-sort label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary, #666);
    margin-bottom: 4px;
    margin-top: 14px;
}

.tirage-claim select,
.tirage-claim input,
.tirage-sort input {
    width: 100%;
    padding: 10px 0;
    border: none;
    border-bottom: 2px solid rgba(0,0,0,0.1);
    background: transparent;
    font-size: 1rem;
    color: var(--text-primary, #333);
    outline: none;
    margin-bottom: 4px;
}

.tirage-claim select:focus,
.tirage-claim input:focus,
.tirage-sort input:focus {
    border-color: var(--accent, #8B6914);
}

.tirage-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
    margin: 16px 0;
}

.tirage-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 6px;
    background: var(--bg-card, #fff);
    border: 2px solid rgba(218,165,32,0.2);
    border-radius: 10px;
    transition: transform 0.4s;
}

.tirage-card .hebrew {
    font-size: 1.6rem;
    color: var(--accent, #8B6914);
    line-height: 1;
}

.tirage-card .card-name {
    font-size: 0.55rem;
    color: var(--text-muted, #999);
    margin-top: 4px;
    text-align: center;
}

.tirage-reveal {
    text-align: center;
    padding: 30px 0;
    animation: revealFade 0.8s ease;
}

@keyframes revealFade {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.tirage-reveal h2 {
    font-family: 'Georgia', serif;
    font-size: 1.8rem;
    color: var(--accent, #8B6914);
    margin-bottom: 8px;
}

.reveal-ange, .reveal-lettre {
    color: var(--text-secondary, #666);
    margin: 4px 0;
}

.reveal-code {
    margin: 20px 0;
    padding: 16px;
    background: rgba(218,165,32,0.06);
    border-radius: 12px;
    border: 1px solid rgba(218,165,32,0.15);
}

.code-display {
    font-size: 2rem;
    font-family: monospace;
    color: var(--accent, #8B6914);
    letter-spacing: 0.3em;
}

.reveal-note {
    font-size: 0.8rem;
    color: var(--text-muted, #999);
    margin-top: 8px;
}

.tirage-done {
    text-align: center;
    padding: 40px 0;
}

.tirage-done h2 {
    font-family: 'Georgia', serif;
    color: var(--accent, #8B6914);
}

/* ── Meditation (link to Noosphere) ── */

.meditation-stone-header {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 420px;
}

.meditation-stone-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent, #DAA520);
    box-shadow: 0 0 12px rgba(218,165,32,0.15);
}

.meditation-stone-name {
    font-family: 'Georgia', serif;
    font-size: 1.3rem;
    color: var(--accent, #8B6914);
    margin: 0;
}

.meditation-stone-ange {
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
    margin: 2px 0 0;
}

.meditation-open-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 420px;
    padding: 28px 24px;
    background: linear-gradient(135deg, #0a0a1a, #1a1a3e);
    border-radius: 20px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.meditation-open-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.meditation-open-icon {
    font-size: 3rem;
}

.meditation-open-title {
    font-family: 'Georgia', serif;
    font-size: 1.2rem;
    color: #ffd700;
    font-weight: bold;
}

.meditation-open-desc {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    text-align: center;
}

.meditation-share {
    text-align: center;
    width: 100%;
    max-width: 420px;
}

.meditation-share p {
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
    margin-bottom: 10px;
}

.meditation-info {
    width: 100%;
    max-width: 420px;
    padding: 16px 20px;
    background: rgba(218,165,32,0.04);
    border: 1px solid rgba(218,165,32,0.1);
    border-radius: 12px;
}

.meditation-info p {
    font-size: 0.8rem;
    color: var(--text-secondary, #666);
    margin: 0 0 8px;
    font-weight: 600;
}

.meditation-info ul {
    margin: 0;
    padding-left: 18px;
    font-size: 0.8rem;
    color: var(--text-secondary, #666);
    line-height: 1.7;
}

/* ── Install banner ── */

.install-banner {
    position: fixed;
    bottom: 70px;
    left: 12px;
    right: 12px;
    background: linear-gradient(135deg, #fff9ee, #fff);
    border: 2px solid #DAA520;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    z-index: 200;
    animation: slideUp 0.4s ease;
}

.install-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.install-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.install-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.install-text strong {
    font-size: 1rem;
    color: #8B6914;
}

.install-text span {
    font-size: 0.8rem;
    color: #666;
}

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

.install-btn {
    flex-shrink: 0;
    padding: 10px 20px;
    font-size: 0.9rem;
    white-space: nowrap;
}

.install-dismiss {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted, #999);
    cursor: pointer;
    padding: 4px;
}

/* ── Temoignages ─────────────────────────────────────────────── */

.temoignages-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0 0.5rem;
}

.temoignage-card {
    background: var(--bg-card, #fffdf8);
    border: 1px solid var(--border-light, #E8E0D4);
    border-radius: 12px;
    padding: 1.2rem;
    box-shadow: 0 1px 4px rgba(139, 105, 20, 0.06);
}

.temoignage-contenu {
    color: var(--text-primary, #2C2418);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0.8rem;
    white-space: pre-wrap;
}

.temoignage-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted, #9B8E7E);
    border-top: 1px solid var(--border-light, #E8E0D4);
    padding-top: 0.6rem;
}

.temoignage-gardien {
    font-weight: 600;
    color: var(--gold-dark, #8B6914);
}

.temoignage-date {
    font-style: italic;
}

/* ── SVG Icons ── */

.action-icon-svg {
    width: 28px;
    height: 28px;
    color: var(--accent, #8B6914);
    margin-bottom: 4px;
}

.nav-icon-svg {
    width: 22px;
    height: 22px;
    color: var(--text-muted, #999);
}

.nav-btn.active .nav-icon-svg {
    color: var(--accent, #8B6914);
}

.login-logo svg {
    opacity: 0.8;
}

/* ── Temoignages cards (server-rendered) ── */

.pdp-temoignage-card {
    background: var(--bg-card, #fff);
    border-left: 3px solid #DAA520;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.pdp-temoignage-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-primary, #333);
    margin: 0 0 10px;
    font-style: italic;
    white-space: pre-line;
}

.pdp-temoignage-footer {
    display: flex;
    gap: 10px;
    font-size: 0.75rem;
    color: var(--text-muted, #999);
}

.pdp-temoignage-gardien {
    color: var(--accent, #8B6914);
    font-weight: 600;
}
