/* Part 2: the letters. The room is the cabin's (warm dark wood, the swaying lamp); every pen has its own paper,
   seal and type: soturno (grey-blue paper, wine seal, roman), dourado (ivory, gold seal, italic), the mask (dusk
   lilac, silver-violet seal with one gold thread, small capitals), neutro (pearl, sea-glass seal). */
html.em-cartas, html.em-cartas body { background: radial-gradient(90% 60% at 50% 0%, #3A2A1E 0%, #1F1813 55%, #120E0B 100%) fixed; }
.cartas { position: relative; min-height: 100dvh; padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); display: grid; gap: 16px; align-content: start; max-width: 820px; margin: 0 auto; }
.ct-abas { display: flex; gap: 6px; border-bottom: 1px solid rgba(203, 196, 180, .2); }
.ct-aba { display: inline-flex; align-items: center; min-height: 48px; padding: 10px 14px; color: #C9BBA6; font: 17px/1.2 var(--letra-titulo); text-decoration: none; border-bottom: 2px solid transparent; }
.ct-aba[aria-current] { color: var(--perola); border-bottom-color: #E6C46E; }
.ct-conteudo { display: grid; gap: 18px; outline: none; }
.cartas h2 { font-size: 22px; color: var(--perola); margin-bottom: 8px; }

/* papers */
.ct-papel { position: relative; padding: 22px 20px 18px; border-radius: 4px 7px 5px 6px; box-shadow: 0 10px 28px rgba(0, 0, 0, .45); }
.ct-papel.ct-soturno { background: linear-gradient(170deg, #DCE3E4, #C9D3D6); color: #1F2930; font-family: var(--letra-titulo); }
.ct-papel.ct-neutro { background: linear-gradient(170deg, #F1EBE0, #E4DCCD); color: #1F2930; font-family: var(--letra-titulo); }
.ct-papel.ct-dourado { background: linear-gradient(170deg, #FBF6EA, #EFE4CB); color: #4A3A1E; font-family: var(--letra-titulo); font-style: italic; }
.ct-papel.ct-mascara { background: linear-gradient(170deg, #E3DAEC, #CBBFDB); color: #2E2440; font-family: "IM Fell English SC", var(--letra-titulo); letter-spacing: .02em; }
.ct-papel.ct-mascara::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 10px; height: 1px; background: linear-gradient(90deg, transparent, #C9A45C 40%, transparent 60%); opacity: .7; }
.ct-texto { width: 100%; min-height: 220px; border: 0; background: transparent; color: inherit; font: inherit; font-size: 19px; line-height: 1.6; resize: vertical; outline: none;
  background-image: repeating-linear-gradient(transparent 0 29.4px, rgba(60, 60, 80, .12) 29.4px 30.4px); }
.ct-texto:focus-visible { box-shadow: 0 0 0 2px rgba(30, 84, 102, .35); border-radius: 4px; }
.ct-texto::placeholder { color: inherit; opacity: .45; }
.ct-assina { text-align: right; font-size: 19px; margin-top: 8px; }
.ct-linha { display: flex; justify-content: space-between; }
.ct-conta { font: 13px/1 var(--letra-meta); color: #C9BBA6; }

/* seals */
.ct-selo { display: inline-block; flex: none; width: 22px; height: 22px; border-radius: 50% 46% 52% 48%; box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .14); }
.ct-selo.ct-soturno, .ct-lacre-grande.ct-soturno { background: radial-gradient(circle at 35% 35%, #9A4A58, #5E1F2C); }
.ct-selo.ct-dourado, .ct-lacre-grande.ct-dourado { background: radial-gradient(circle at 35% 35%, #F3DC97, #BE9440); }
.ct-selo.ct-mascara, .ct-lacre-grande.ct-mascara { background: radial-gradient(circle at 35% 35%, #D9D2E8, #8E86A8); box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .12), 0 0 0 1px #C9A45C; }
.ct-selo.ct-neutro, .ct-lacre-grande.ct-neutro { background: radial-gradient(circle at 35% 35%, #BFE3DF, #3E8C93); }
.ct-lacre-grande { position: absolute; left: 50%; top: 40%; width: 84px; height: 84px; margin: -42px; border-radius: 50% 46% 52% 48%; }

/* the desk's choices */
.ct-mesa { display: grid; gap: 16px; }
.ct-grupo { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
.ct-grupo legend { font: 400 18px/1.2 var(--letra-titulo); color: var(--perola); margin-bottom: 6px; }
.ct-opcoes { display: flex; flex-wrap: wrap; gap: 8px; }
.ct-opcao { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 12px; border: 1px solid rgba(203, 196, 180, .3); border-radius: 10px; background: rgba(18, 14, 11, .5); color: #E9DFCF; font: 15px/1.2 var(--letra-texto); cursor: pointer; }
.ct-opcao img { width: 34px; height: 34px; object-fit: contain; }
.ct-opcao[aria-pressed="true"] { border-color: #E6C46E; background: rgba(230, 196, 110, .14); color: var(--perola); }
.ct-acoes { display: flex; justify-content: flex-end; }

/* the chest */
.ct-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ct-envelope { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; border-radius: 6px; background: #EFE6DA; color: #2A3238; text-decoration: none; box-shadow: 0 6px 16px rgba(0, 0, 0, .35); }
.ct-envelope[data-estilo="mascara"] { background: #DDD3E8; }
.ct-envelope[data-estilo="dourado"] { background: #F7F0E0; }
.ct-env-texto { display: grid; gap: 2px; flex: 1; }
.ct-env-texto span { font-size: 14px; color: #6B5E4E; }
.ct-nova { font: italic 14px/1 var(--letra-titulo); color: #8E2F3A; }

/* reading */
.ct-leitura { display: grid; gap: 16px; }
@media (min-width: 760px) { .ct-leitura { grid-template-columns: 1fr 180px; align-items: start; } }
.ct-carta .ct-corpo { white-space: pre-line; font-size: 19px; line-height: 1.6; }
.ct-cabeca { font-size: 15px; opacity: .75; margin-bottom: 10px; }
.ct-era { font-size: 15px; }
.ct-objeto { margin: 0; display: grid; justify-items: center; gap: 6px; color: #C9BBA6; font: italic 15px/1.3 var(--letra-titulo); text-align: center; }
.ct-objeto img { width: 140px; height: 140px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .35)); }

/* the mask's corner */
.ct-mascara { display: grid; gap: 10px; padding: 16px; border-radius: 12px; border: 1px solid rgba(201, 164, 92, .4); background: rgba(46, 36, 64, .45); }
.ct-mascara h2 { font-family: "IM Fell English SC", var(--letra-titulo); }
.ct-mascara form { display: grid; gap: 8px; }
.ct-parte { position: fixed; left: 0; top: 0; width: 180px; z-index: 50; pointer-events: none; }

/* the messenger on the deck, and the reveal */
.nv-mensageiro { position: absolute; z-index: 3; right: 5%; bottom: 52%; width: 110px; border: 0; padding: 0; background: none; cursor: pointer; }
.nv-mensageiro img { width: 100%; height: auto; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .4)); }
.nv-mensageiro.gaivota img { animation: nv-pousa 5s ease-in-out infinite; }
.nv-mensageiro.garrafa img { animation: nv-onda 4s ease-in-out infinite; }
.nv-mensageiro span { display: block; margin-top: 4px; font: italic 14px/1.2 var(--letra-titulo); color: var(--perola); text-shadow: 0 1px 6px rgba(0, 0, 0, .8); }
@keyframes nv-pousa { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(2deg); } }
@keyframes nv-onda { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(5px) rotate(4deg); } }
@media (min-width: 900px) { .nv-mensageiro { right: 22%; bottom: 30%; width: 150px; } }
.revelacao { position: fixed; inset: 0; z-index: 60; display: grid; place-content: center; gap: 18px; padding: 24px; text-align: center; background: radial-gradient(circle, rgba(46, 36, 64, .96), rgba(10, 8, 16, .98)); color: var(--perola); }
.rv-mascara { pointer-events: none; justify-self: center; width: 180px; height: 90px; border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%; background: linear-gradient(160deg, #E3DAEC, #8E86A8); box-shadow: 0 0 0 2px #C9A45C, 0 10px 30px rgba(0, 0, 0, .5); position: relative; }
.rv-mascara::before, .rv-mascara::after { content: ""; position: absolute; top: 32px; width: 46px; height: 22px; border-radius: 50%; background: #1A1424; }
.rv-mascara::before { left: 30px; }
.rv-mascara::after { right: 30px; }
.revelacao h2 { font: 400 clamp(26px, 6vw, 40px)/1.2 "IM Fell English SC", var(--letra-titulo); }
.revelacao p { font: italic 20px/1.4 var(--letra-titulo); }
@media (prefers-reduced-motion: reduce) { .nv-mensageiro img { animation: none !important; } }
