:root {
  color-scheme: light;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: #18364c;
  background: #f2f8fc;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #18364c;
  --muted: #718797;
  --sky: #e5f3fc;
  --blue: #2386bf;
  --blue-dark: #176590;
  --line: #e6eef3;
  --card-shadow: 0 10px 30px rgba(37, 78, 105, .07);
}

* { box-sizing: border-box; }
body { margin: 0; padding-bottom: 92px; }
button, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, textarea:focus-visible { outline: 3px solid #71bce5; outline-offset: 3px; }
.app-shell { width: min(100% - 36px, 690px); margin: 0 auto; }
.topbar { display: flex; min-height: 78px; align-items: center; gap: 14px; border-bottom: 1px solid rgba(205, 223, 235, .8); }
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; color: var(--ink); font: 800 30px/1 'Segoe UI', Arial, sans-serif; letter-spacing: -2px; text-decoration: none; }
.brand-logo { display: block; width: 38px; height: 38px; overflow: visible; border-radius: 9px; }
.brand-logo .dyaro-spark { opacity: 0; transform: scale(.45); transform-origin: 348px 179px; pointer-events: none; }
.brand-logo .dyaro-halo { opacity: .1; }
.brand-logo .dyaro-particles { opacity: 0; }
.brand.bursting .dyaro-spark { animation: dyaro-ignite .75s both cubic-bezier(.24, .65, .25, 1); }
.brand.bursting .dyaro-halo { animation: dyaro-glow .75s both; }
.brand.bursting .dyaro-particles { animation: dyaro-flecks .75s both; }
.brand:focus-visible { outline: 3px solid #71bce5; outline-offset: 4px; border-radius: 10px; }
@keyframes dyaro-ignite { 0% { opacity: 0; transform: scale(.3) rotate(-12deg); } 16% { opacity: 1; transform: scale(1.1) rotate(3deg); } 45% { opacity: 1; transform: scale(1.03); } 100% { opacity: 0; transform: scale(.7) translateY(-11px); } }
@keyframes dyaro-glow { 0% { opacity: 0; } 18% { opacity: .98; } 80% { opacity: .3; } 100% { opacity: 0; } }
@keyframes dyaro-flecks { 0% { opacity: 0; transform: translate(0, 0); } 20% { opacity: 1; } 70% { opacity: 1; transform: translate(12px, -10px); } 100% { opacity: 0; transform: translate(25px, -23px); } }
@media (hover: hover) and (pointer: fine) { .brand:hover { filter: drop-shadow(0 5px 8px #126f9422); } }
@media (prefers-reduced-motion: reduce) {
  .brand.bursting .dyaro-spark { animation: none; opacity: 1; transform: none; }
  .brand.bursting .dyaro-particles { animation: none; opacity: 1; }
  .brand.bursting .dyaro-halo { animation: none; opacity: .65; }
}
.brand span { color: var(--blue); }
.tagline { margin: 2px auto 0 0; color: var(--muted); font-size: 12px; }
.header-actions { display: flex; align-items: center; gap: 13px; }
.icon-button, .profile-chip { position: relative; display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; cursor: pointer; }
.icon-button svg { width: 19px; height: 19px; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.notification-dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border: 1px solid #fff; border-radius: 50%; background: #48a6d8; }
.profile-chip, .avatar { flex: 0 0 auto; display: grid; place-items: center; border: 0; border-radius: 50%; background: #dceefa; color: #226b93; font-weight: 700; }
.profile-chip { background: #dcedf8; font-size: 13px; }
.welcome { padding: 29px 0 22px; }
.eyebrow { margin: 0 0 7px; color: #4689ad; font-size: 10px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 7px; font: 700 clamp(25px, 6vw, 34px)/1.2 'Segoe UI', Arial, sans-serif; letter-spacing: -1.1px; }
.welcome > p:last-child { margin: 0; color: var(--muted); font-size: 14px; }
.panel { border: 1px solid #e3edf4; border-radius: 20px; background: #fff; box-shadow: var(--card-shadow); }
.composer { padding: 19px; }
.composer-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 15px; }
.avatar { width: 39px; height: 39px; font-size: 13px; }
.composer-heading h2 { margin: 0; font-size: 15px; font-weight: 700; }
textarea { display: block; width: 100%; min-height: 88px; resize: vertical; border: 0; border-radius: 12px; background: #f5f9fc; padding: 14px; color: var(--ink); font-size: 14px; line-height: 1.6; }
textarea::placeholder { color: #8396a3; }
.composer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.media-options, .submit-area { display: flex; align-items: center; gap: 12px; }
.media-option { display: inline-flex; min-height: 38px; align-items: center; gap: 6px; border: 0; background: transparent; padding: 5px 0; color: #597487; cursor: pointer; font-size: 11px; }
.media-option:hover { color: var(--blue-dark); }
.media-option svg, .text-option svg { width: 17px; height: 17px; fill: none; stroke: #3c99c9; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.text-option { display: inline-flex; align-items: center; gap: 6px; color: #597487; font-size: 11px; }
.character-count { color: #8a9ba7; font-size: 10px; white-space: nowrap; }
.publish-button { min-height: 40px; border: 0; border-radius: 12px; background: var(--blue); padding: 0 15px; color: #fff; cursor: pointer; font-size: 12px; font-weight: 700; }
.publish-button:hover { background: var(--blue-dark); }
.publish-button span { margin-left: 8px; }
.status { margin: 8px 0 0; color: #226b54; font-size: 12px; }
.status:empty { display: none; }
.feed { margin-top: 29px; }
.feed-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 13px; }
.feed-heading .eyebrow { margin-bottom: 5px; }
.feed-heading h2 { margin: 0; font: 700 21px/1.2 'Segoe UI', Arial, sans-serif; letter-spacing: -.5px; }
.feed-mark { color: #56a9d4; font-size: 25px; }
.post-list { display: grid; gap: 15px; }
.post-card { overflow: hidden; border: 1px solid #e3edf4; border-radius: 19px; background: #fff; box-shadow: 0 7px 22px rgba(37, 78, 105, .05); }
.post-header { display: flex; align-items: center; gap: 10px; padding: 15px 16px 11px; }
.post-header .avatar { width: 39px; height: 39px; }
.avatar-lina { background: #f8e8d8; color: #a2693b; }
.avatar-mateo { background: #e7e6fb; color: #6358a0; }
.avatar-sofia { background: #e3f1e6; color: #4a7d58; }
.post-author { min-width: 0; }
.post-author strong { display: block; color: var(--ink); font-size: 12px; }
.post-author time { display: block; margin-top: 3px; color: #8596a3; font-size: 10px; }
.delete-post { margin-left: auto; border: 0; border-radius: 9px; background: transparent; padding: 7px 9px; color: #8596a3; cursor: pointer; font: inherit; font-size: 10px; }
.delete-post:hover, .delete-post:focus-visible { background: #fff1ef; color: #a14a42; }
.delete-post:focus-visible { outline: 2px solid #a14a42; outline-offset: 2px; }
.post-copy { margin: 0; padding: 0 16px 14px; color: #37556a; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; }
.post-art { position: relative; display: grid; height: 168px; overflow: hidden; place-items: center; }
.post-art::before, .post-art::after { position: absolute; content: ''; border-radius: 50%; }
.art-coast { background: linear-gradient(170deg, #c4e9f6 0 48%, #82c9dc 48% 62%, #5bafc9 62%); }
.art-coast::before { right: 16%; bottom: 30px; width: 55px; height: 55px; background: #f7d38a; box-shadow: 0 0 0 12px rgba(255, 240, 192, .2); }
.art-coast::after { left: -8%; bottom: -63px; width: 75%; height: 110px; background: #e8f4e9; transform: rotate(-9deg); box-shadow: 250px -19px 0 8px #d7ece5; }
.art-coffee { background: linear-gradient(135deg, #f2dfcc, #d9c8b7); }
.art-coffee::before { width: 91px; height: 91px; background: #fffaf2; box-shadow: 0 7px 14px #71543a24; }
.art-coffee::after { width: 54px; height: 54px; background: radial-gradient(circle at center, #eee2ce 0 26%, #9c6545 28% 52%, #f8f0e4 54%); box-shadow: inset 0 0 0 2px #fff; }
.art-garden { background: linear-gradient(155deg, #d8eef1, #b9dccb 58%, #a7cdb3); }
.art-garden::before { left: 20%; bottom: -24px; width: 115px; height: 130px; background: #6ea887; transform: rotate(-35deg); box-shadow: 66px 12px 0 -12px #4f986f, 138px 26px 0 -23px #3c8a69; }
.art-garden::after { right: 18%; top: 24px; width: 52px; height: 52px; background: #fff4cf; box-shadow: 0 0 0 10px #ffffff36; }
.art-caption { position: absolute; z-index: 1; bottom: 12px; left: 14px; border: 1px solid #ffffffaa; border-radius: 20px; background: #ffffffd9; padding: 6px 10px; color: #34586b; font-size: 10px; }
.post-actions { display: flex; align-items: center; gap: 4px; padding: 9px 11px 10px; }
.action-button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 10px; background: transparent; padding: 0 9px; color: #657e8e; cursor: pointer; font-size: 11px; }
.action-button:hover { background: #f2f8fc; }
.action-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.action-button[aria-pressed="true"] { color: #167fb6; }
.action-button:last-child { margin-left: auto; }
.storage-note { margin: 8px 0 0; color: #8596a3; font-size: 10px; line-height: 1.5; }
.site-footer { padding: 24px 0 8px; color: #8596a3; text-align: center; font-size: 10px; }
.site-footer span { padding: 0 4px; color: #57a3ca; }
.bottom-nav { position: fixed; z-index: 5; right: 0; bottom: 0; left: 0; display: flex; height: 70px; align-items: center; justify-content: center; border-top: 1px solid #e5edf2; background: rgba(255, 255, 255, .96); box-shadow: 0 -6px 22px rgba(28, 64, 87, .06); backdrop-filter: blur(12px); }
.nav-item { position: relative; display: flex; width: min(20%, 112px); height: 62px; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; background: transparent; color: #7c909d; cursor: pointer; font-size: 9px; }
.nav-item svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.is-active { color: var(--blue-dark); font-weight: 700; }
.nav-publish { color: #51788e; }
.publish-icon { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 12px; background: var(--blue); color: #fff; box-shadow: 0 5px 12px #2386bf38; }
.publish-icon svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

@media (min-width: 720px) {
  body { padding-bottom: 32px; }
  .app-shell { width: min(100% - 64px, 700px); }
  .topbar { min-height: 86px; }
  .welcome { padding-top: 39px; }
  .composer { padding: 22px 24px; }
  .post-art { height: 220px; }
  .bottom-nav { right: 50%; bottom: 18px; left: auto; width: min(520px, calc(100% - 40px)); height: 72px; transform: translateX(50%); border: 1px solid #e5edf2; border-radius: 22px; }
  .site-footer { padding-bottom: 105px; }
}

@media (max-width: 390px) {
  .app-shell { width: calc(100% - 26px); }
  .tagline { font-size: 10px; }
  .topbar { gap: 9px; }
  .header-actions { gap: 8px; }
  .composer { padding: 15px; }
  .composer-heading h2 { font-size: 13px; }
  .media-options, .submit-area { gap: 8px; }
  .media-option, .text-option { gap: 4px; font-size: 10px; }
  .publish-button { padding: 0 11px; }
  .character-count { font-size: 9px; }
  .action-button { gap: 4px; padding: 0 6px; font-size: 10px; }
}

@media (prefers-reduced-motion: no-preference) {
  button, a { transition: background-color .15s ease, color .15s ease, transform .15s ease; }
  .publish-button:active, .publish-icon:active { transform: scale(.97); }
}

.space-card { margin: 0 0 18px; padding: 17px; }
.space-top, .space-person, .profile-row, .song-heading, .song-display { display: flex; align-items: center; }
.space-top { justify-content: space-between; gap: 12px; }
.space-person { min-width: 0; gap: 11px; }
.profile-photo-frame { position: relative; display: grid; width: 54px; height: 54px; flex: 0 0 auto; place-items: center; overflow: hidden; border: 2px solid #d5edf9; border-radius: 50%; background: #dceefa; }
.profile-photo { width: 100%; height: 100%; object-fit: cover; }
.profile-initial { color: #226b93; font-size: 17px; font-weight: 700; }
.space-identity .eyebrow { margin-bottom: 3px; font-size: 9px; }
.space-identity h2 { margin: 0; font: 700 16px/1.2 'Segoe UI', Arial, sans-serif; }
.profile-mood-line { margin: 4px 0 0; color: #597487; font-size: 11px; }
.photo-picker { display: inline-flex; min-height: 36px; flex: 0 0 auto; align-items: center; border: 1px solid #dbeaf2; border-radius: 11px; background: #fff; padding: 0 11px; color: #397c9f; cursor: pointer; font-size: 10px; font-weight: 600; }
.photo-picker:hover { background: #f2f9fd; }
.profile-edit { margin-top: 12px; border-top: 1px solid #edf2f5; padding-top: 9px; }
.profile-edit summary { width: fit-content; border-radius: 6px; color: #397c9f; cursor: pointer; font-size: 10px; font-weight: 700; }
.profile-form { display: grid; gap: 10px; margin-top: 10px; }
.profile-row { gap: 10px; align-items: start; }
.profile-field { display: grid; min-width: 0; flex: 1; gap: 5px; color: #647f91; font-size: 10px; font-weight: 600; }
.profile-field input, .profile-field select, .song-fields input { width: 100%; min-height: 37px; border: 1px solid #e2edf3; border-radius: 10px; background: #f8fbfd; padding: 0 10px; color: var(--ink); font-size: 12px; }
.profile-hint, .song-hint { margin: 0; color: #748996; font-size: 10px; line-height: 1.5; }
.song-card { margin-top: 15px; border: 1px solid #e4edf1; border-radius: 14px; background: linear-gradient(120deg, #f7fbfd, #fffaf2); padding: 12px; }
.song-heading { gap: 9px; margin-bottom: 10px; }
.song-note { display: grid; width: 33px; height: 33px; flex: 0 0 auto; place-items: center; border-radius: 11px; background: #e8f3f7; color: #4689ad; font-size: 21px; }
.song-heading .eyebrow { margin: 0 0 2px; font-size: 9px; }
.song-heading h3 { margin: 0; color: var(--ink); font-size: 12px; }
.song-form { display: flex; align-items: end; gap: 8px; }
.song-form[hidden] { display: none; }
.song-fields { display: grid; min-width: 0; flex: 1; grid-template-columns: 1fr 1fr; gap: 6px; }
.song-fields input { min-height: 34px; font-size: 10px; }
#song-url { grid-column: 1 / -1; }
.song-save, .song-open, .song-remove { min-height: 34px; border: 0; border-radius: 9px; background: #e8f3f7; padding: 0 10px; color: #286f91; cursor: pointer; font-size: 10px; font-weight: 700; white-space: nowrap; }
.song-save:hover, .song-open:hover { background: #d7edf6; }
.song-hint { margin-top: 8px; }
.song-display { justify-content: space-between; gap: 10px; margin-top: 10px; border-radius: 11px; background: #fff; padding: 9px; }
.song-display[hidden] { display: none; }
.song-meta { min-width: 0; }
.song-meta strong, .song-meta span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-meta strong { color: var(--ink); font-size: 11px; }
.song-meta span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.song-actions { display: flex; flex: 0 0 auto; gap: 5px; }
.song-remove { background: transparent; color: #788b97; }
.song-edit { border: 0; border-radius: 9px; background: #e8f3f7; padding: 0 9px; color: #286f91; cursor: pointer; font-size: 10px; font-weight: 700; }
.media-preview { position: relative; margin-top: 12px; overflow: hidden; border: 1px solid #e2edf3; border-radius: 12px; background: #f5f9fc; }
.media-preview[hidden] { display: none; }
.media-preview img, .media-preview video { display: block; width: 100%; max-height: 280px; object-fit: contain; background: #eaf3f8; }
.preview-caption { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; color: #5c788a; font-size: 10px; }
.preview-remove { border: 0; border-radius: 8px; background: transparent; padding: 6px 8px; color: #58788b; cursor: pointer; font-size: 10px; }
.post-media { display: block; width: 100%; max-height: 380px; object-fit: contain; background: #eaf3f8; }
.spark-icon { fill: transparent; stroke: currentColor; }
.action-button[aria-pressed="true"] { color: #bf7c10; background: #fff8df; }
.action-button[aria-pressed="true"] .spark-icon { fill: #ffd65e; stroke: #c99119; }
.action-button[data-post-action="save"][aria-pressed="true"] { color: #167fb6; background: #eaf6fb; }
.action-button.is-sparking .spark-icon { animation: spark-pop .42s ease-out; }
.comment-panel { border-top: 1px solid #edf2f5; background: #f9fcfd; padding: 12px 15px 14px; }
.comment-panel[hidden] { display: none; }
.comment-list { display: grid; gap: 7px; margin-bottom: 10px; }
.comment-item { border-radius: 10px; background: #fff; padding: 8px 10px; color: #456276; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.comment-item strong { margin-right: 5px; color: var(--ink); }
.comment-empty, .comment-private { margin: 0 0 8px; color: #80929e; font-size: 10px; }
.comment-private { margin: 8px 0 0; font-size: 9px; }
.comment-form { display: flex; gap: 7px; }
.comment-form input { min-width: 0; flex: 1; min-height: 37px; border: 1px solid #e2edf3; border-radius: 10px; background: #fff; padding: 0 10px; font-size: 11px; }
.comment-form button { min-height: 37px; border: 0; border-radius: 10px; background: #e5f3fc; padding: 0 11px; color: #286f91; cursor: pointer; font-size: 10px; font-weight: 700; }
.comment-form button:hover { background: #d6edf8; }

@keyframes spark-pop {
  0% { transform: scale(1) rotate(0); }
  45% { transform: scale(1.55) rotate(24deg); }
  100% { transform: scale(1) rotate(0); }
}

@media (max-width: 390px) {
  .space-card { padding: 14px; }
  .photo-picker { padding: 0 8px; font-size: 9px; }
  .song-form { align-items: stretch; flex-direction: column; }
  .song-save { align-self: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.space-card { margin: 0 0 16px; padding: 0; }
.space-summary { display: flex; min-height: 83px; align-items: center; gap: 12px; padding: 12px 15px; cursor: pointer; list-style: none; }
.space-summary::-webkit-details-marker { display: none; }
.space-summary::marker { content: ''; }
.space-summary:hover { background: #fbfdfe; }
.space-summary .profile-photo-frame { width: 50px; height: 50px; }
.space-summary-copy { display: grid; min-width: 0; flex: 1; gap: 3px; }
.space-summary-copy .eyebrow { margin: 0; font-size: 8px; }
.space-summary-copy strong { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.profile-note-line, .profile-mood-line, .profile-song-line { overflow: hidden; color: #6e8491; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.profile-mood-line[hidden], .profile-note-line[hidden], .profile-song-line[hidden] { display: none; }
.profile-song-line { display: flex; min-width: 0; align-items: center; gap: 8px; }
.profile-song-line > span { overflow: hidden; text-overflow: ellipsis; }
.listen-link { flex: 0 0 auto; color: #227da8; font-size: 10px; font-weight: 700; text-decoration: none; }
.listen-link:hover { text-decoration: underline; }
.edit-space-label { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; color: #387b9d; font-size: 9px; font-weight: 700; }
.space-summary[open] .edit-space-label span { transform: rotate(180deg); }
.profile-edit { border-top: 1px solid #edf2f5; padding: 13px 15px 15px; }
.space-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.space-editor-heading .eyebrow { margin: 0 0 3px; font-size: 8px; }
.space-editor-heading h2 { margin: 0; font-size: 14px; }
.profile-edit .profile-form { margin: 0; }
.visibility-switch { position: relative; display: flex; width: fit-content; align-items: center; gap: 9px; color: #496879; cursor: pointer; font-size: 11px; font-weight: 600; }
.visibility-switch input { position: absolute; z-index: 1; left: 0; width: 35px; height: 20px; margin: 0; opacity: 0; cursor: pointer; }
.switch-track { position: relative; width: 35px; height: 20px; flex: 0 0 auto; border-radius: 20px; background: #c8d6de; transition: background .15s ease; }
.switch-track::after { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #1b354322; content: ''; transition: transform .15s ease; }
.visibility-switch input:checked + .switch-track { background: #3197c8; }
.visibility-switch input:checked + .switch-track::after { transform: translateX(15px); }
.visibility-switch input:focus-visible + .switch-track { outline: 3px solid #71bce5; outline-offset: 3px; }
.profile-mood-fields[hidden] { display: none; }
.song-editor { display: grid; gap: 8px; border: 1px solid #e4edf1; border-radius: 12px; background: #f9fcfd; padding: 10px; }
.song-editor h3 { margin: 0; color: var(--ink); font-size: 11px; }
.song-editor .song-fields { grid-template-columns: 1fr 1fr; }
.song-editor .song-fields input { min-height: 36px; font-size: 11px; }
.song-options { align-items: end; }
.profile-save-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.save-feedback { margin: 0; color: #47745e; font-size: 10px; line-height: 1.45; }
.profile-hint, .song-hint { color: #647d8b; font-size: 10px; line-height: 1.5; }

body.messages-mode .app-shell > header,
body.messages-mode .app-shell > main,
body.messages-mode .app-shell > .site-footer { display: none; }
.messages-view { width: 100%; min-height: calc(100vh - 105px); padding: 22px 0 18px; }
.messages-view[hidden] { display: none; }
.messages-heading { display: flex; align-items: center; gap: 16px; margin-bottom: 13px; }
.messages-heading h1 { margin: 0; font-size: 25px; }
.messages-heading .eyebrow { margin-bottom: 3px; }
.back-button { min-height: 38px; border: 1px solid #dce9f0; border-radius: 11px; background: #fff; padding: 0 12px; color: #397c9f; cursor: pointer; font-size: 11px; font-weight: 700; }
.back-button:hover { background: #f0f8fc; }
.local-disclaimer, .game-local-note { border: 1px solid #dceaf1; border-radius: 11px; background: #f7fbfd; padding: 10px 12px; color: #617b8b; font-size: 11px; line-height: 1.5; }
.chat-layout { display: grid; align-items: start; gap: 15px; }
.conversation, .duel-panel { min-width: 0; padding: 15px; }
.conversation-heading { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #eaf0f4; padding-bottom: 12px; }
.avatar-chat { background: #e3f2f9; color: #2582af; }
.conversation-heading h2 { margin: 0 0 3px; font-size: 13px; }
.conversation-heading span { color: #8194a0; font-size: 10px; }
.chat-messages, .game-chat-messages { display: flex; min-height: 125px; max-height: 230px; flex-direction: column; gap: 8px; overflow-y: auto; padding: 11px 2px; }
.chat-notice { align-self: center; max-width: 94%; margin: 0; border-radius: 10px; background: #f2f7fa; padding: 8px 10px; color: #738896; text-align: center; font-size: 10px; line-height: 1.5; }
.chat-bubble { display: grid; width: fit-content; max-width: 88%; gap: 3px; margin: 0; border-radius: 12px; padding: 8px 10px; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.chat-bubble strong { font-size: 9px; }
.chat-bubble.player-azul { align-self: flex-start; background: #eaf5fb; color: #285c77; }
.chat-bubble.player-coral { align-self: flex-end; background: #fff0e9; color: #814f40; }
.chat-form { display: flex; align-items: center; gap: 7px; border-top: 1px solid #eaf0f4; padding-top: 10px; }
.chat-form select, .chat-form input { min-width: 0; min-height: 39px; border: 1px solid #e2edf3; border-radius: 10px; background: #fbfdfe; padding: 0 9px; color: var(--ink); font-size: 11px; }
.chat-form select { max-width: 115px; }
.chat-form input { flex: 1; }
.chat-send { width: 39px; height: 39px; flex: 0 0 auto; border: 0; border-radius: 11px; background: var(--blue); color: #fff; cursor: pointer; font-size: 18px; font-weight: 700; }
.chat-send:hover { background: var(--blue-dark); }
.play-invite { width: 100%; min-height: 43px; margin-top: 12px; border: 0; border-radius: 12px; background: #e9f6fc; color: #286f91; cursor: pointer; font-size: 12px; font-weight: 700; }
.play-invite:hover { background: #d9eef8; }
.game-invite { margin-top: 10px; border: 1px solid #e2edf3; border-radius: 12px; background: #fbfdfe; padding: 12px; }
.game-invite[hidden], .duel-panel[hidden], #game-active[hidden], #game-setup[hidden] { display: none; }
.game-invite p { margin: 0 0 10px; color: #647d8b; font-size: 11px; }
.duel-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.duel-panel-heading .eyebrow { margin: 0 0 3px; font-size: 9px; }
.duel-panel-heading h2 { margin: 0; font-size: 17px; }
.close-game { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border: 1px solid #e2edf3; border-radius: 50%; background: #fff; color: #597487; cursor: pointer; font-size: 23px; }
.game-local-note { margin: 11px 0; font-size: 10px; }
.game-setup { display: grid; gap: 11px; }
.game-setup .profile-row { gap: 8px; }
.player-one-field { color: #357ca4; }
.player-two-field { color: #b96a51; }
.start-game { justify-self: start; }
.turn-banner { margin: 14px 0 9px; border-radius: 12px; background: #eaf5fb; padding: 11px; color: #246d93; text-align: center; font-size: 14px; font-weight: 800; }
.turn-banner:not(:empty) { min-height: 42px; }
.scoreboard { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.score-player { display: grid; gap: 4px; border: 1px solid #e5edf2; border-radius: 11px; background: #fff; padding: 9px; }
.score-player strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.score-player span { color: #6f8491; font-size: 10px; }
.score-player.player-azul { border-left: 3px solid #4698c2; }
.score-player.player-coral { border-left: 3px solid #df8a6c; }
.score-player.is-turn { box-shadow: 0 0 0 2px #9dd4ec; }
.game-rules { margin: 10px 0; color: #617b8b; font-size: 10px; line-height: 1.5; }
.game-layout { display: grid; gap: 12px; }
.board-wrap { min-width: 0; overflow: auto; border: 1px solid #dce8ef; border-radius: 12px; background: #f3f8fb; padding: 7px; overscroll-behavior-x: contain; }
.spark-board { display: grid; width: max-content; min-width: 100%; gap: 3px; }
.spark-row { display: grid; grid-template-columns: repeat(var(--board-columns), 34px); gap: 3px; }
.spark-cell { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid #d4e3eb; border-radius: 7px; background: linear-gradient(145deg, #fff, #e4f2f9); color: #3d748e; cursor: pointer; font-size: 12px; font-weight: 800; touch-action: manipulation; }
.spark-cell:hover:not(:disabled) { border-color: #64afd1; background: #d8eff9; transform: translateY(-1px); }
.spark-cell:disabled { cursor: default; }
.spark-cell.is-revealed { border-color: #e8eef1; background: #f7fafb; }
.spark-cell.mine-azul { border-color: #8dcbe2; background: #d8f0fa; color: #24749b; font-size: 17px; }
.spark-cell.mine-coral { border-color: #f0b29b; background: #ffebe2; color: #b6583b; font-size: 17px; }
.spark-cell.number-0 { color: #a7b7c0; }
.spark-cell.number-1 { color: #247bb2; }
.spark-cell.number-2 { color: #40916d; }
.spark-cell.number-3 { color: #d26648; }
.spark-cell.number-4, .spark-cell.number-5, .spark-cell.number-6, .spark-cell.number-7, .spark-cell.number-8 { color: #795aa7; }
.game-chat { min-width: 0; border: 1px solid #e4edf3; border-radius: 13px; background: #fff; padding: 11px; }
.game-chat h3 { margin: 0; font-size: 12px; }
.game-chat-messages { min-height: 86px; max-height: 145px; }
.game-chat-form { gap: 5px; padding-top: 8px; }
.game-chat-form select { width: 51px; padding: 0 3px; font-size: 9px; }
.game-chat-form input { padding: 0 7px; font-size: 10px; }
.game-chat-form .chat-send { width: 34px; height: 36px; }
.game-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.game-result { margin: 0; color: #31754f; font-size: 12px; font-weight: 800; }
.game-footer-buttons { display: flex; gap: 7px; }
.game-footer-buttons .back-button { min-height: 34px; padding: 0 9px; font-size: 10px; }

@media (min-width: 760px) {
  .messages-view { min-height: calc(100vh - 110px); padding-top: 30px; }
  .chat-layout { grid-template-columns: minmax(260px, .8fr) minmax(0, 1.6fr); }
  .messages-view:has(.duel-panel:not([hidden])) .chat-layout { grid-template-columns: minmax(245px, .75fr) minmax(0, 1.7fr); }
  .game-layout { grid-template-columns: minmax(0, 1fr) 205px; align-items: start; }
  .spark-row { grid-template-columns: repeat(var(--board-columns), 30px); gap: 2px; }
  .spark-board { gap: 2px; }
  .spark-cell { width: 30px; height: 30px; border-radius: 6px; }
}

@media (max-width: 390px) {
  .space-summary { min-height: 77px; gap: 9px; padding: 10px 11px; }
  .space-summary .profile-photo-frame { width: 44px; height: 44px; }
  .edit-space-label { font-size: 8px; }
  .profile-edit { padding-right: 11px; padding-left: 11px; }
  .messages-view { padding-top: 15px; }
  .conversation, .duel-panel { padding: 12px; }
  .spark-row { grid-template-columns: repeat(var(--board-columns), 32px); }
  .spark-cell { width: 32px; height: 34px; }
}
