/* RESET VITRUVIANO */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #f5f1e8;
    font-family: 'Cardo', serif;
    color: #2c1810;
    position: fixed;
}

/* PERGAMINHO DE FUNDO */
.vellum-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><path d="M0,0 L100,0 L100,100 L0,100 Z" fill="none" stroke="%232c1810" stroke-width="0.2" stroke-opacity="0.05"/></svg>'),
        radial-gradient(circle at 30% 30%, rgba(44, 24, 16, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(139, 69, 19, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* CANVAS PARA VISUALIZAÇÕES */
.wave-canvas, .fractal-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    opacity: 0.3;
}

.fractal-canvas {
    z-index: 1;
    opacity: 0.1;
}

.golden-spiral {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border: 2px solid rgba(218, 165, 32, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 3;
    transition: all 2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* NAVEGAÇÃO RENASCENTISTA EXPANDIDA */
.renaissance-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: rgba(245, 241, 232, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(44, 24, 16, 0.1);
}

.nav-seal {
    position: relative;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.seal-circle, .seal-square {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.seal-circle {
    width: 35px;
    height: 35px;
    border: 1px solid #2c1810;
    border-radius: 50%;
    opacity: 0.3;
}

.seal-square {
    width: 35px;
    height: 35px;
    border: 1px solid #2c1810;
    opacity: 0.3;
    transform: translate(-50%, -50%) rotate(45deg);
}

.seal-text {
    position: absolute;
    font-family: 'Cormorant', serif;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #8b4513;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid rgba(44, 24, 16, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    color: #2c1810;
}

.nav-btn:hover {
    border-color: #8b4513;
    background: rgba(139, 69, 19, 0.1);
    transform: translateY(-2px);
}

.studiolo-toggle {
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid rgba(44, 24, 16, 0.2);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.studiolo-toggle:hover {
    border-color: #8b4513;
    transform: rotate(90deg);
}

.studiolo-dot {
    width: 3px;
    height: 3px;
    background: #2c1810;
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* STUDIOLO EXPANDIDO */
.studiolo-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: rgba(245, 241, 232, 0.98);
    backdrop-filter: blur(20px);
    padding: 4rem 1rem 1rem;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow-y: auto;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
}

.studiolo-menu.active {
    right: 0;
}

.studiolo-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(44, 24, 16, 0.1);
}

.studiolo-header h3 {
    font-family: 'Cormorant', serif;
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: 3px;
    color: #8b4513;
    text-align: center;
}

.studiolo-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.codex-search {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(44, 24, 16, 0.2);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.8);
    font-family: 'Cardo', serif;
    font-size: 0.9rem;
}

.studiolo-close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid rgba(44, 24, 16, 0.2);
    border-radius: 50%;
    font-size: 1.2rem;
    color: #2c1810;
    cursor: pointer;
    transition: all 0.3s ease;
}

.studiolo-close:hover {
    border-color: #8b4513;
    transform: rotate(90deg);
}

.codex-categories {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    margin-bottom: 1.5rem;
    -webkit-overflow-scrolling: touch;
}

.category-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(139, 69, 19, 0.2);
    border-radius: 20px;
    font-family: 'Cormorant', serif;
    font-size: 0.85rem;
    color: #2c1810;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.category-btn.active {
    background: rgba(139, 69, 19, 0.1);
    border-color: #8b4513;
    color: #8b4513;
}

.codex-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.codex-item {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(139, 69, 19, 0.2);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.codex-item:hover {
    background: rgba(139, 69, 19, 0.1);
    border-color: rgba(139, 69, 19, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.codex-category {
    font-size: 0.7rem;
    color: #8b4513;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* HOMEM VITRUVIANO */
.vitruvian-man {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem 6rem;
    z-index: 2;
}

/* GEOMETRIA VITRUVIANA EXPANDIDA */
.cosmic-circle {
    position: absolute;
    width: min(90vw, 400px);
    height: min(90vw, 400px);
    border: 1px solid rgba(139, 69, 19, 0.3);
    border-radius: 50%;
    pointer-events: none;
    animation: circleRotate 120s infinite linear;
}

.earth-square {
    position: absolute;
    width: min(90vw, 400px);
    height: min(90vw, 400px);
    border: 1px solid rgba(44, 24, 16, 0.3);
    pointer-events: none;
    animation: squarePulse 60s infinite ease-in-out;
}

.golden-rectangle {
    position: absolute;
    width: calc(min(90vw, 400px) * 1.618);
    height: min(90vw, 400px);
    border: 1px solid rgba(218, 165, 32, 0.2);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

@keyframes circleRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes squarePulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.4; }
}

.central-axis {
    position: absolute;
    width: 1px;
    height: min(90vw, 400px);
    background: linear-gradient(to bottom, transparent, #8b4513, transparent);
    opacity: 0.2;
    pointer-events: none;
}

/* PONTOS VITRUVIANOS (Arrastáveis) */
.vitruvian-points {
    position: relative;
    width: min(90vw, 400px);
    height: min(90vw, 400px);
    touch-action: none;
}

.vit-point {
    position: absolute;
    top: calc(var(--y) - 25px);
    left: calc(var(--x) - 25px);
    width: 50px;
    height: 50px;
    cursor: grab;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    touch-action: none;
}

.vit-point:active {
    cursor: grabbing;
}

.point-orb {
    position: absolute;
    width: 25px;
    height: 25px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    transition: all 0.4s ease;
    border: 2px solid;
}

.point-glow {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: all 0.4s ease;
    filter: blur(8px);
}

.point-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    font-weight: 600;
    color: #2c1810;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.vit-point:hover .point-label {
    opacity: 0.8;
}

/* CORES VITRUVIANAS */
.point-crown .point-orb { 
    background: #8b4513;
    border-color: #5d2c0d;
}
.point-crown .point-glow { background: #8b4513; }

.point-third-eye .point-orb { 
    background: #4a235a;
    border-color: #30193b;
}
.point-third-eye .point-glow { background: #4a235a; }

.point-throat .point-orb { 
    background: #1e5799;
    border-color: #143b6b;
}
.point-throat .point-glow { background: #1e5799; }

.point-heart .point-orb { 
    background: #228b22;
    border-color: #1a6b1a;
}
.point-heart .point-glow { background: #228b22; }

.point-solar .point-orb { 
    background: #daa520;
    border-color: #b8860b;
}
.point-solar .point-glow { background: #daa520; }

.point-sacral .point-orb { 
    background: #cd853f;
    border-color: #a0522d;
}
.point-sacral .point-glow { background: #cd853f; }

.point-root .point-orb { 
    background: #8b0000;
    border-color: #5d0000;
}
.point-root .point-glow { background: #8b0000; }

/* EFEITOS VITRUVIANOS EXPANDIDOS */
.vit-point:hover .point-orb {
    transform: translate(-50%, -50%) scale(1.5);
    box-shadow: 0 0 25px currentColor;
}

.vit-point:hover .point-glow {
    opacity: 0.4;
    transform: translate(-50%, -50%) scale(1.5);
}

.vit-point.active .point-orb {
    animation: vitruvianSpin 2s infinite linear;
    transform: translate(-50%, -50%) scale(1.8);
    box-shadow: 0 0 35px currentColor;
}

.vit-point.active .point-glow {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(2.2);
    animation: vitruvianPulse 1.5s infinite ease-in-out;
}

.vit-point.dragging {
    z-index: 100;
}

.vit-point.dragging .point-orb {
    transform: translate(-50%, -50%) scale(2);
    box-shadow: 0 0 40px currentColor;
}

@keyframes vitruvianSpin {
    from { transform: translate(-50%, -50%) scale(1.8) rotate(0deg); }
    to { transform: translate(-50%, -50%) scale(1.8) rotate(360deg); }
}

@keyframes vitruvianPulse {
    0%, 100% { opacity: 0.4; transform: translate(-50%, -50%) scale(2); }
    50% { opacity: 0.8; transform: translate(-50%, -50%) scale(2.4); }
}

/* INTERFACE VITRUVIANA EXPANDIDA */
.vitruvian-interface {
    width: 95%;
    max-width: 500px;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(139, 69, 19, 0.2);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.golden-ratio {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.ratio-display {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.ratio-value {
    font-family: 'Cormorant', serif;
    font-size: 2rem;
    font-weight: 700;
    color: #8b4513;
}

.ratio-symbol {
    font-family: 'Cardo', serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: #daa520;
}

.ratio-label {
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #2c1810;
    opacity: 0.6;
}

.fibonacci-sequence {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.fib-num {
    font-family: 'Cormorant', serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #8b4513;
    opacity: 0.8;
    transition: all 0.3s ease;
}

/* CONTROLES DE ÁUDIO */
.audio-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.waveform-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.wave-btn {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(44, 24, 16, 0.2);
    border-radius: 8px;
    color: #2c1810;
    font-family: 'Cormorant', serif;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.wave-btn.active {
    background: rgba(139, 69, 19, 0.1);
    border-color: #8b4513;
    color: #8b4513;
}

.harmonic-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: #2c1810;
}

.harmonic-controls label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#harmonicSlider {
    flex: 1;
    height: 4px;
    background: linear-gradient(90deg, #8b0000, #8b4513, #daa520);
    border-radius: 2px;
    outline: none;
    appearance: none; /* Padrão moderno */
    -webkit-appearance: none; /* Para compatibilidade */
    -moz-appearance: none; /* Para Firefox */
}

#harmonicSlider::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    background: #2c1810;
    border: 2px solid #8b4513;
    border-radius: 50%;
    cursor: pointer;
    appearance: none; /* Padrão moderno */
    -webkit-appearance: none; /* Para compatibilidade */
    -moz-appearance: none; /* Para Firefox */
}

#harmonicSlider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #2c1810;
    border: 2px solid #8b4513;
    border-radius: 50%;
    cursor: pointer;
    appearance: none;
    -moz-appearance: none;
}

/* RÉGUA DE FREQUÊNCIA */
.roman-cubit {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.cubit-track {
    position: relative;
    width: 100%;
    height: 4px;
    background: linear-gradient(
        90deg,
        #8b0000,
        #cd853f,
        #daa520,
        #228b22,
        #1e5799,
        #4a235a,
        #8b4513
    );
    border-radius: 2px;
    cursor: pointer;
    overflow: visible;
}

.cubit-slider {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    cursor: grab;
    transition: left 0.1s ease;
}

.slider-hand {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #2c1810;
    border-radius: 50%;
    border: 2px solid #8b4513;
    box-shadow: 
        inset 0 0 10px rgba(255, 255, 255, 0.3),
        0 0 20px rgba(139, 69, 19, 0.5);
}

.cubit-slider:active {
    cursor: grabbing;
}

.cubit-marks {
    position: absolute;
    top: -8px;
    width: 100%;
    height: 16px;
    pointer-events: none;
}

.mark {
    position: absolute;
    width: 1px;
    height: 100%;
    background: rgba(44, 24, 16, 0.4);
}

.cubit-scale {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: #2c1810;
    opacity: 0.6;
    padding: 0 0.5rem;
}

/* CONTROLES RENASCENTISTAS EXPANDIDOS */
.renaissance-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    width: 100%;
}

.control-btn {
    padding: 0.7rem;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(139, 69, 19, 0.3);
    border-radius: 12px;
    color: #2c1810;
    font-family: 'Cormorant', serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.control-btn i {
    font-size: 1.1rem;
    opacity: 0.8;
}

.control-btn:hover {
    background: rgba(139, 69, 19, 0.1);
    border-color: rgba(139, 69, 19, 0.6);
    transform: translateY(-2px);
}

.control-btn:active {
    transform: translateY(0);
}

/* MEDIDAS VITRUVIANAS EXPANDIDAS */
.vitruvian-measures {
    position: fixed;
    bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    z-index: 3;
    width: 100%;
    padding: 0 1rem;
}

.measure {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    min-width: 80px;
}

.measure-value {
    font-family: 'Cormorant', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #8b4513;
}

.measure-label {
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #2c1810;
    opacity: 0.6;
}

/* MODO JOGO */
.game-panel {
    position: fixed;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    background: rgba(245, 241, 232, 0.95);
    border: 2px solid #8b4513;
    border-radius: 16px;
    padding: 1rem;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
}

.game-panel.active {
    display: block;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(44, 24, 16, 0.2);
}

.game-header h3 {
    font-family: 'Cormorant', serif;
    font-size: 1.1rem;
    color: #8b4513;
}

.game-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #2c1810;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.game-close:hover {
    background: rgba(44, 24, 16, 0.1);
}

.game-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.game-challenge {
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.4;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
}

.game-timer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.timer-bar {
    width: 100%;
    height: 8px;
    background: rgba(44, 24, 16, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.timer-bar::after {
    content: '';
    display: block;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #8b0000, #228b22);
    border-radius: 4px;
    transform-origin: left;
    animation: timerShrink 30s linear forwards;
}

@keyframes timerShrink {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

.timer-text {
    font-size: 0.8rem;
    color: #2c1810;
    text-align: center;
}

.game-progress {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-label {
    font-size: 0.8rem;
    color: #2c1810;
    opacity: 0.8;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
}

.step {
    width: 30px;
    height: 30px;
    border: 2px solid rgba(44, 24, 16, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #2c1810;
}

.step.completed {
    background: #228b22;
    border-color: #228b22;
    color: white;
}

/* NOTIFICAÇÃO DE PAPIRO EXPANDIDA */
.papyrus-notification {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(245, 241, 232, 0.95);
    border: 1px solid rgba(139, 69, 19, 0.3);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    transition: top 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 500px;
}

.papyrus-notification.active {
    top: 4.5rem;
}

.notification-close {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: #2c1810;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.notification-close:hover {
    background: rgba(44, 24, 16, 0.1);
}

.scroll-text {
    font-family: 'Cormorant', serif;
    font-size: 0.9rem;
    color: #2c1810;
    letter-spacing: 0.5px;
}

/* ANOTAÇÃO MARGINAL EXPANDIDA */
.marginal-note {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    max-width: 300px;
    background: rgba(245, 241, 232, 0.95);
    border-left: 4px solid #8b4513;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: none;
    z-index: 1000;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.marginal-note.active {
    display: block;
    animation: noteSlideIn 0.3s ease;
}

@keyframes noteSlideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.note-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #8b4513;
    font-style: italic;
}

.note-close {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: #2c1810;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.note-close:hover {
    background: rgba(44, 24, 16, 0.1);
}

.note-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.note-text {
    font-family: 'Cardo', serif;
    font-size: 0.85rem;
    color: #2c1810;
    line-height: 1.4;
    font-style: italic;
    flex: 1;
}

.note-symbol {
    font-size: 1rem;
    color: #8b4513;
    margin-top: 0.1rem;
}

/* MODAL DE COMPARTILHAMENTO */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.share-modal.active {
    display: flex;
}

.modal-content {
    background: rgba(245, 241, 232, 0.98);
    border-radius: 16px;
    padding: 1.5rem;
    width: 90%;
    max-width: 400px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(44, 24, 16, 0.2);
}

.modal-header h3 {
    font-family: 'Cormorant', serif;
    font-size: 1.3rem;
    color: #8b4513;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #2c1810;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    background: rgba(44, 24, 16, 0.1);
}

.share-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.share-option {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(139, 69, 19, 0.2);
    border-radius: 12px;
    color: #2c1810;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.share-option:hover {
    background: rgba(139, 69, 19, 0.1);
    border-color: #8b4513;
    transform: translateY(-2px);
}

.share-option i {
    font-size: 1.2rem;
}

.share-preview {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(139, 69, 19, 0.2);
    border-radius: 12px;
    padding: 1rem;
}

.preview-title {
    font-family: 'Cormorant', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #8b4513;
    margin-bottom: 0.75rem;
    text-align: center;
}

.preview-data {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.data-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #2c1810;
}

/* RESPONSIVIDADE OTIMIZADA */
@media (min-width: 768px) {
    .renaissance-nav {
        padding: 1rem 2rem;
    }
    
    .nav-seal {
        width: 60px;
        height: 60px;
    }
    
    .seal-circle {
        width: 40px;
        height: 40px;
    }
    
    .seal-square {
        width: 40px;
        height: 40px;
    }
    
    .studiolo-menu {
        width: 500px;
        right: -500px;
    }
    
    .codex-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .renaissance-controls {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .vitruvian-measures {
        gap: 2.5rem;
    }
    
    .measure-value {
        font-size: 1.8rem;
    }
}

@media (orientation: landscape) and (max-height: 600px) {
    .vitruvian-man {
        padding: 3rem 1rem 4rem;
    }
    
    .vitruvian-interface {
        margin-top: 1rem;
        padding: 1rem;
        gap: 0.8rem;
    }
    
    .vitruvian-measures {
        bottom: 0.5rem;
        gap: 1rem;
    }
    
    .measure {
        min-width: 70px;
    }
    
    .measure-value {
        font-size: 1.2rem;
    }
}

/* UTILITÁRIOS */
.hidden {
    display: none !important;
}

/* ANIMAÇÕES RENASCENTISTAS */
@keyframes inkSpread {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes manuscriptFade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* SCROLLBAR DE PERGAMINHO */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(139, 69, 19, 0.05);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(139, 69, 19, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 69, 19, 0.3);
}