@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=DM+Sans:wght@300;400;500&display=swap');

:root { color-scheme: dark; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: #151116; color: #fff; font-family: Georgia, 'Times New Roman', serif; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; font-weight: 400; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid #d4b16d; outline-offset: 2px; }
.container { max-width: 900px; margin: 0 auto; padding: 0 24px; }
.container.xs { max-width: 444px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* Calendario */
.site-shell { min-height: 100vh; position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 0%, #38232d 0%, #1b151c 42%, #121014 100%); }
.ambient { position: absolute; width: 320px; height: 320px; border-radius: 50%; filter: blur(100px); opacity: .14; pointer-events: none; }
.ambient-one { background: #9c3548; top: 10%; left: -180px; }
.ambient-two { background: #b38b48; right: -200px; top: 48%; }
.main-container { position: relative; z-index: 1; padding-top: 54px; padding-bottom: 28px; }
.hero { text-align: center; padding: 12px 12px 38px; }
.eyebrow, .section-kicker { letter-spacing: .25em; color: #d0ad69; font-size: .68rem; }
.eyebrow { line-height: 2.66; }
.section-kicker { font-family: 'DM Sans', sans-serif; }
.hero-title, .admin-title, .section-heading h2, .clue-heading, .tile-day { font-family: 'Cormorant Garamond', Georgia, serif; }
.hero-title, .admin-title { font-weight: 500; letter-spacing: .01em; }
.hero-title { font-size: clamp(3.1rem, 8vw, 5.8rem); line-height: .98; margin: 12px 0; color: #f3e5cf; }
.hero-subtitle { color: #b9a995; font-size: .98rem; font-weight: 300; }
.gold-line { width: 72px; height: 1px; background: #a88a52; margin: 26px auto 17px; }
.hero-date { color: #c4a66d; letter-spacing: .15em; font-size: .68rem; }

.alert { padding: 14px 16px; border-radius: 7px; margin-bottom: 16px; font-size: .875rem; }
.alert.info { background: #071318; color: #b8e7fb; }
.alert.warning { background: #191207; color: #ffe2b7; }
.alert.error { background: #160b0b; color: #f4c7c7; margin: 16px 0 0; }

.calendar-section { max-width: 700px; margin: 0 auto; padding: 26px; border: 1px solid rgba(193,157,94,.25); border-radius: 22px; background: rgba(23,19,25,.72); box-shadow: 0 22px 70px rgba(0,0,0,.22); }
.section-heading { text-align: center; margin-bottom: 24px; }
.section-heading h2 { font-size: 2rem; line-height: 1.33; margin: 6px 0; }
.section-heading p { font-size: .875rem; }
.calendar-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.calendar-tile { min-width: 0; min-height: 112px; padding: 12px 5px; border-radius: 13px; border: 1px solid rgba(190,154,93,.5); color: #e9d5ad; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: linear-gradient(145deg, #35232d, #211a23); transition: transform .2s, border-color .2s, box-shadow .2s; }
.calendar-tile.available:hover { transform: translateY(-4px); border-color: #e0bd77; box-shadow: 0 8px 25px rgba(197,158,87,.15); background: linear-gradient(145deg, #50303a, #29202a); }
.calendar-tile.locked { cursor: default; color: rgba(255,255,255,.3); border-color: rgba(140,119,94,.22); background: linear-gradient(145deg, #252027, #1c191f); }
.calendar-tile.opened { border-color: #d4b16d; background: #4b3336; }
.tile-icon { width: 20px; height: 20px; fill: #c9a45d; }
.locked .tile-icon { fill: #746b66; }
.tile-day { font-size: 2rem; line-height: 1; }
.tile-month { font-size: .58rem; letter-spacing: .17em; color: #bba47c; }
.site-footer { text-align: center; color: #897b70; font-family: 'DM Sans', sans-serif; font-size: .75rem; padding: 30px 8px 8px; letter-spacing: .04em; }

/* Finestra indizio */
.clue-dialog { width: calc(100% - 64px); max-width: 600px; padding: 0; color: #fff; text-align: center; border: 1px solid rgba(205,169,103,.45); border-radius: 7px; background: radial-gradient(ellipse at top, #402833, #211a22 65%); box-shadow: 0 24px 38px 3px rgba(0,0,0,.3); }
.clue-dialog::backdrop { background: rgba(0,0,0,.5); }
.dialog-inner { padding: 12px; }
.dialog-title { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; color: #d1ad6a; letter-spacing: .14em; font-size: .7rem; font-weight: 500; }
.icon-btn { display: grid; padding: 8px; border: 0; border-radius: 50%; background: none; color: #fff; }
.icon-btn:hover { background: rgba(255,255,255,.08); }
.icon-btn svg { width: 24px; height: 24px; fill: currentColor; }
.dialog-content { padding: 0 24px 20px; }
.clue-heading { color: #f1dfc2; margin-bottom: 16px; font-size: 2.125rem; line-height: 1.235; }
.final .clue-heading { font-size: 3rem; line-height: 1.167; }
.clue-body { white-space: pre-wrap; line-height: 1.8; color: #d5c6b2; padding: 0 10px 28px; font-size: 1.02rem; }

/* Accesso riservato + admin */
.gate-page, .admin-page { min-height: 100vh; padding: 50px 0; background: radial-gradient(ellipse at top, #38232d, #151116 70%); }
.gate-page { display: flex; align-items: center; }
.gate-card { max-width: 440px; margin: auto; padding: 36px; text-align: center; border: 1px solid rgba(193,157,94,.3); border-radius: 22px; background: #211a22; }
.gate-card .hero-title { font-size: 3.4rem; }
.admin-page > .container { padding-top: 42px; }
.overline { font-size: .75rem; letter-spacing: .08em; line-height: 2.66; }
.admin-title { font-size: clamp(2.5rem, 6vw, 4rem); line-height: 1.17; }
.admin-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.admin-page h2 { font-size: 1.5rem; margin-bottom: 16px; }
.admin-page h3 { font-size: 1.25rem; font-weight: 500; margin-bottom: 8px; }
.admin-page hr { border: 0; border-top: 1px solid rgba(255,255,255,.12); margin: 24px 0; }
.mb { margin-bottom: 24px; }
.admin-days { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-page label { display: block; margin-bottom: 16px; font-size: .875rem; color: rgba(255,255,255,.7); }
.admin-page input:not([type=checkbox]), .admin-page textarea { display: block; width: 100%; margin-top: 6px; padding: 14px; font: inherit; font-size: 1rem; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.23); border-radius: 7px; resize: vertical; }
.admin-page input:focus, .admin-page textarea:focus { outline: none; border-color: #fff; box-shadow: inset 0 0 0 1px #fff; }
.admin-page label.check { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 1rem; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: #fff; }
.btn { min-width: 64px; padding: 6px 16px; border: 1px solid rgba(255,255,255,.5); border-radius: 7px; background: transparent; color: #fff; font-size: .875rem; font-weight: 500; letter-spacing: .03em; line-height: 1.75; text-transform: uppercase; }
.btn:hover { background: rgba(255,255,255,.08); }
.btn.text { border-color: transparent; }
.btn.contained { background: #fff; border-color: #fff; color: rgba(0,0,0,.87); }
#msg { margin-top: 16px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.full { width: 100%; margin-top: 16px; }

@media (max-width: 599px) {
  .container { padding: 0 16px; }
  .clue-dialog { width: calc(100% - 32px); }
}
@media (max-width: 520px) {
  .main-container { padding: 28px 14px 18px; }
  .hero { padding-bottom: 26px; }
  .calendar-section { padding: 18px 13px; border-radius: 17px; }
  .calendar-grid { gap: 8px; }
  .calendar-tile { min-height: 94px; }
  .tile-day { font-size: 1.7rem; }
  .hero-date { font-size: .58rem; }
}
