@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Fraunces:ital,opsz,wght@0,9..144,700;0,9..144,900;1,9..144,700&display=swap');

:root { color-scheme: light; font-family: "DM Sans", sans-serif; color: #242a24; background: #f6f1e7; }
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid #d88945; outline-offset: 3px; }
.page { max-width: 1160px; margin: auto; padding: 0 42px; }
.topbar { height: 90px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #d9d4c9; }
.brand { color: #242a24; font-family: "Fraunces", Georgia, serif; font-weight: 900; font-size: 34px; letter-spacing: -1.7px; text-decoration: none; }
.brand span:first-child { color: #e8774e; }
.brand-dot { color: #6d8d68; }
.text-button { color: #303d31; background: none; border: 0; font-weight: 700; font-size: 16px; text-decoration: underline; text-underline-offset: 4px; }
.intro { position: relative; padding: 65px 0 47px; max-width: 760px; }
.food-doodle { display: block; fill: none; stroke: #b98a6d; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; opacity: .38; pointer-events: none; }
.calcots-doodle { position: absolute; top: 5px; right: 0; width: 52px; height: 52px; }
.botifarra-doodle { width: 70px; height: 44px; margin-left: auto; flex: none; }
.intro-botifarra { position: absolute; top: 8px; right: 20%; transform: rotate(-12deg); }
.game-botifarra { width: 58px; height: 36px; margin: 4px 0 0; transform: rotate(12deg); }
.eyebrow, .section-label { font-size: 12px; font-weight: 800; letter-spacing: 1px; color: #596955; }
.eyebrow { display: flex; align-items: center; gap: 12px; }
.eyebrow time { color: #788073; letter-spacing: .5px; text-transform: uppercase; }
.caganer { display: block; flex: none; }
.caganer-small { width: 30px; height: 30px; }
.caganer-note { width: 46px; height: 46px; }
.intro-line { width: 30px; height: 1px; background: #b7c0b0; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: "Fraunces", Georgia, serif; }
h1 { margin-top: 21px; font-size: clamp(28px, 3.8vw, 48px); line-height: 1.08; letter-spacing: -1px; }
h1 em { color: #d97753; font-weight: 700; }
.intro-help { margin-top: 20px; padding: 0; }
.layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 22px; align-items: stretch; }
.game-card, .discovery-card { border: 1px solid #ded9cc; border-radius: 20px; padding: 30px; }
.game-card { background: #fffdf8; box-shadow: 0 9px 30px #3f4b3010; }
.discovery-card { background: #e9eee2; display: flex; flex-direction: column; }
.card-heading, .discovery-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h2 { font-size: 26px; letter-spacing: -.8px; margin-top: 7px; }
.daily-badge { background: #f7e6d9; color: #a34d32; border-radius: 50%; width: 64px; height: 64px; flex: none; display: grid; place-content: center; text-align: center; font-size: 11px; font-weight: 800; line-height: 1.4; transform: rotate(9deg); }
.hint { color: #703b2a; background: #faeee4; border-left: 4px solid #a84b2f; border-radius: 6px; font-size: 16px; line-height: 1.55; margin-top: 14px; padding: 10px 12px; }
.hint strong { color: #a13e25; }
.hint p + p { margin-top: 6px; }
#word-form { text-align: center; }
#word-input { width: 100%; margin-top: 26px; background: transparent; border: 0; border-bottom: 2px solid #d9decf; padding: 12px 8px; text-align: center; color: #27382b; font-family: "Fraunces", Georgia, serif; font-size: 25px; letter-spacing: 1px; }
#word-input::placeholder { color: #6c7869; font-size: 20px; font-style: italic; letter-spacing: 0; }
.feedback { min-height: 36px; padding: 10px 0 3px; color: #8d452f; font-size: 16px; line-height: 1.5; }
.feedback:not(:empty) { margin-bottom: 24px; }
.board-ornaments { position: relative; width: min(100%, 330px); height: 36px; margin: 0 auto; }
.board-ornaments .board-botifarra { position: absolute; left: 0; top: -18px; width: 44px; height: 28px; transform: rotate(-12deg); }
.board-ornaments .board-calcot { position: absolute; right: 0; top: 75px; width: 32px; height: 32px; transform: rotate(12deg); }
.board-ornaments-bottom { margin-bottom: 12px; }
.board-ornaments-bottom .board-calcot { left: 0; right: auto; top: -70px; transform: rotate(-12deg); }
.board-ornaments-bottom .board-botifarra { left: auto; right: 12%; top: 0; transform: rotate(12deg); }
.letters { position: relative; width: min(100%, 300px); aspect-ratio: 1; margin: 0 auto; background: url("./icons/sardana.svg") center / 96% no-repeat; }
.letter { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); width: min(66px, 25%); aspect-ratio: 1; border: 1px solid #c9d2c2; border-radius: 42% 52% 46% 50%; background: #edf2e8; color: #354b37; font-family: "Fraunces", Georgia, serif; font-weight: 900; font-size: 28px; box-shadow: 0 4px 0 #d9e0d2; }
.letter:nth-child(1) { --x: 50%; --y: 50%; }
.letter:nth-child(2) { --x: 36.4%; --y: 26.8%; }
.letter:nth-child(3) { --x: 63.6%; --y: 26.8%; }
.letter:nth-child(4) { --x: 76.8%; --y: 50%; }
.letter:nth-child(5) { --x: 63.6%; --y: 73.2%; }
.letter:nth-child(6) { --x: 36.4%; --y: 73.2%; }
.letter:nth-child(7) { --x: 23.2%; --y: 50%; }
.letter:hover { background: #dce8d9; }
.letter:active { transform: translate(-50%, calc(-50% + 3px)); box-shadow: 0 1px 0 #d9e0d2; }
.center-letter, .center-letter:hover { background: #a84b2f; color: white; border-color: #a84b2f; box-shadow: 0 4px 0 #803821; }
.center-letter:active { box-shadow: 0 1px 0 #803821; }
.actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.submit-action { flex-basis: 100%; }
.actions button { padding-left: 10px; padding-right: 10px; }
.primary-button, .secondary-button, .share-button { border-radius: 10px; padding: 13px 22px; font-size: 16px; font-weight: 800; }
.primary-button { background: #365743; color: white; border: 1px solid #365743; }
.primary-button:hover { background: #263f30; }
.primary-button span { margin-left: 12px; }
.secondary-button { background: transparent; color: #526553; border: 1px solid #d0d8c9; }
.length-table { width: min(100%, 300px); margin: 24px auto 0; border-collapse: collapse; color: #405943; font-size: 15px; }
.length-table th, .length-table td { padding: 4px 8px; text-align: left; }
.length-table thead { color: #596955; }
.length-table tbody th { font-weight: 500; }
.length-complete { color: #365743; font-weight: 800; }
.hint-area { position: relative; text-align: center; margin-top: 44px; }
.hint-count { margin-bottom: 10px; color: #405943; font-size: 16px; font-weight: 700; }
.hint-botifarra { position: absolute; right: 0; top: -38px; width: 44px; height: 28px; transform: rotate(12deg); }
.hint-area button { margin: 0 3px 8px; }
.hint-result { background: #f7eee2; border-radius: 10px; padding: 14px; color: #405643; text-align: left; font-size: 16px; line-height: 1.55; }
.hint-result strong { color: #8d452f; }
button:disabled { opacity: .5; cursor: default; }
.count { font-family: "Fraunces", Georgia, serif; font-size: 23px; font-weight: 700; color: #49694b; white-space: nowrap; }
.progress-track { height: 7px; background: #d4dfce; border-radius: 10px; margin-top: 30px; overflow: hidden; }
#progress-fill { background: #759b72; height: 100%; width: 0; transition: width .2s; }
.progress-caption { color: #526a54; font-size: 15px; margin-top: 9px; }
.discoveries { flex: 1; padding: 10px 0; }
.empty-state { min-height: 210px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: #526a54; text-align: center; font-size: 16px; }
.empty-state strong { color: #405943; font-size: 17px; }
.word-item { padding: 14px 0; border-bottom: 1px solid #d3ddce; }
.word-item h3 { font-family: "Fraunces", Georgia, serif; font-size: 21px; color: #3b6042; }
.word-item p { color: #4f6252; line-height: 1.55; font-size: 16px; margin-top: 5px; }
.grossa-badge { display: inline-block; margin-top: 6px; padding: 3px 9px; border-radius: 12px; background: #f7e6d9; color: #843d28; font-size: 14px; font-weight: 800; }
.share-button { width: 100%; background: transparent; border: 1px solid #aebfaa; color: #4a694d; }
.share-button:hover { background: #dfe9db; }
.share-status:not(:empty) { margin-top: 10px; color: #405943; font-size: 15px; }
.storage-notice { margin-top: 20px; color: #8a402f; font-size: 16px; }
.history-card { margin-top: 22px; border: 1px solid #ded9cc; border-radius: 20px; padding: 24px 30px; background: #fffdf8; }
.history-card > p { margin-top: 10px; color: #526553; font-size: 15px; line-height: 1.5; }
.history-stats { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 20px 0; }
.history-stats[hidden] { display: none; }
.history-stats > div { flex: 1 1 140px; }
.history-stats dt { color: #526553; font-size: 15px; }
.history-stats dd { margin: 4px 0 0; color: #365743; font-family: "Fraunces", Georgia, serif; font-size: 26px; font-weight: 700; }
.history-register { margin: 20px 0; }
.history-register summary { color: #365743; cursor: pointer; font-size: 16px; font-weight: 800; }
.history-register summary:focus-visible { outline: 3px solid #d88945; outline-offset: 3px; }
.history-empty { margin-top: 14px; color: #526553; font-size: 16px; }
.history-word { padding: 10px 0; border-bottom: 1px solid #d3ddce; }
.history-word h3 { color: #3b6042; font-family: "Fraunces", Georgia, serif; font-size: 19px; }
.history-word p { color: #4f6252; font-size: 16px; line-height: 1.55; margin-top: 5px; }
.bottom-note { margin: 42px 0; display: flex; gap: 15px; align-items: center; color: #596455; font-size: 15px; line-height: 1.7; }
.bottom-note strong { color: #495c48; font-size: 16px; }
footer { border-top: 1px solid #d9d4c9; min-height: 74px; display: flex; justify-content: space-between; align-items: center; gap: 15px; color: #687466; font-size: 11px; font-weight: 800; letter-spacing: 1px; }
dialog { max-width: 480px; max-height: calc(100% - 32px); width: calc(100% - 32px); border: 0; border-radius: 18px; padding: 30px; color: #303d31; background: #fffdf8; box-shadow: 0 20px 70px #0003; }
dialog::backdrop { background: #23332799; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; }
.dialog-heading h2 { margin: 0; }
.close-button { border: 0; background: none; font-size: 28px; color: #526553; line-height: 1; }
dialog ul { padding-left: 20px; }
dialog li, dialog p { color: #4d594c; font-size: 16px; line-height: 1.65; margin: 10px 0; }
dialog .primary-button { margin-top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 700px) {
  .page { padding: 0 20px; }
  .topbar { height: 72px; }
  .brand { font-size: 30px; }
  .intro { padding: 44px 0 32px; }
  .calcots-doodle { top: 2px; width: 38px; height: 38px; }
  .botifarra-doodle { width: 52px; height: 33px; }
  .intro-botifarra { top: 2px; right: 30%; }
  .game-botifarra { width: 48px; height: 30px; }
  h1 { letter-spacing: -1px; }
  .layout { grid-template-columns: 1fr; gap: 16px; }
  .game-card, .discovery-card { padding: 23px; }
  .game-card { display: flex; flex-direction: column; }
  .card-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; }
  .card-heading > div { display: contents; }
  .card-heading .section-label { grid-column: 1; grid-row: 1; }
  .card-heading .daily-badge { grid-column: 2; grid-row: 1; }
  .card-heading h2 { grid-column: 1 / -1; grid-row: 2; }
  #word-input { margin-top: 12px; }
  .feedback:empty { min-height: 0; padding: 0; }
  .board-ornaments { height: 16px; }
  .board-ornaments-bottom { margin-bottom: 8px; }
  .hint-area { margin-top: 24px; }
  .game-card .hint { order: 1; }
  .game-card .game-botifarra { order: 2; }
  .bottom-note { margin: 30px 0; }
}
