/* Resenha 1.6 · Início. Uses the theme tokens from themes.js; element ids are client.js contracts. */
#home { background: var(--bg-rail); overflow: auto; }
#home .home-wrap { max-width: 1120px; margin: 0 auto; padding: 44px 32px 40px; display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; box-sizing: border-box; }
#home .home-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
#home .home-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

#home .home-brand { text-align: left; margin: 0 0 4px; display: flex; flex-direction: column; gap: 8px; }
#home .home-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
#home .home-logo img { width: 46px; height: 34px; object-fit: contain; border-radius: 0; box-shadow: none; }
#home .home-logo span { font-size: 18px; font-weight: 800; letter-spacing: -.02em; color: var(--text-hi); }
#home .home-brand h1 { margin: 0; font-size: 40px; line-height: 1.1; font-weight: 800; letter-spacing: -.03em; color: var(--text-hi); }
#home .home-brand p { margin: 0; font-size: 16px; line-height: 1.45; font-weight: 400; letter-spacing: 0; color: var(--muted); }

#home .card { background: var(--bg-side); border: 1px solid var(--line); border-radius: 20px; padding: 22px 24px; box-shadow: none; }
#home .card p { margin: 0; }
#home .field { margin: 0; gap: 8px; }
#home .field label { font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--muted); }
#home .field > label { justify-content: flex-start; gap: 4px; }
#home .field input:not([type=color]):not([type=checkbox]) { min-height: 48px; box-sizing: border-box; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-panel); color: var(--text-hi); font-size: 15px; }
#home .field input:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px var(--accent-soft); }
#home .home-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
#home .home-row .field { flex: 1 1 260px; }
#home .btn.big { width: auto; min-height: 48px; padding: 0 26px; border-radius: 14px; font-size: 15px; font-weight: 700; flex: none; }
#home .btn.primary { background: var(--blurple); border: 0; color: #fff; }
#home .btn.primary:hover { background: var(--blurple-h); }
#home .btn:not(.primary) { background: transparent; border: 1px solid var(--line); color: var(--text-hi); }
#home .btn:not(.primary):hover { background: var(--hover); }
#home .btn:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }

#home .home-join { display: flex; flex-direction: column; gap: 16px; }
#home .home-join #join-hint { order: 3; }
#home #join-addr { font-family: inherit; font-size: 20px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
#home #join-addr::placeholder { letter-spacing: .12em; color: var(--muted2); font-weight: 600; opacity: .55; }
#home .home-pass { max-width: 320px; }
#home .home-pass label .muted { font-weight: 400; }

#home #recent { display: flex; flex-direction: column; gap: 6px; margin: 0; }
#home #recent:empty { display: none; }
#home #recent .field label { font-size: 12px; }
#home .recent-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; background: var(--bg-panel); border: 1px solid transparent; cursor: pointer; font-size: 14px; }
#home .recent-item:hover { border-color: var(--line); background: var(--hover); }
#home .recent-item .x { display: flex; padding: 6px; border-radius: 8px; color: var(--muted); opacity: 1; }
#home .recent-item .x:hover { color: var(--red); background: var(--bg-side); }

#home .home-create { display: flex; flex-direction: column; gap: 12px; }
#home .home-more summary { cursor: pointer; width: max-content; font-size: 13px; font-weight: 600; color: var(--muted); padding: 4px 0; }
#home .home-more summary:hover { color: var(--text-hi); }
#home .home-more[open] summary { margin-bottom: 12px; }
#home .home-more .row { gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
#home .home-more .row .field:first-child { width: 120px; flex: none; }
#home .home-more .row .field.grow { flex: 1 1 200px; }
#home .home-more .check { font-size: 13px; color: var(--text); }

#home .error { text-align: left; margin: -8px 4px 0; min-height: 0; font-size: 14px; color: var(--red); }
#home .error:empty { display: none; }
:root:not(.light) #home .error { color: #f87171; }

#home .home-rooms { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 0; }
#home .home-rooms.hidden, #home .home-rooms:empty { display: none; }
#home .home-rooms h2 { margin: 0 0 2px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
#home .home-rooms > p { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
#home .home-rooms > p.muted.small:last-child { margin-top: 6px; font-size: 12px; color: var(--muted2); overflow-wrap: anywhere; }
#home .saved-room { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 16px; background: var(--bg-side); border: 1px solid var(--line); }
#home .saved-room-badge { width: 44px; height: 44px; flex: none; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800; background: var(--bg-panel); color: var(--muted); }
#home .saved-room[data-state=online] .saved-room-badge { background: var(--accent-soft); color: var(--link); }
#home .saved-room-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
#home .saved-room-info b { font-size: 15px; color: var(--text-hi); overflow-wrap: anywhere; }
#home .saved-room-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
#home .saved-room-status::before { content: ''; width: 8px; height: 8px; flex: none; border-radius: 50%; box-sizing: border-box; border: 1.5px solid var(--muted); }
#home .saved-room[data-state=online] .saved-room-status::before { background: var(--green); border-color: var(--green); }
#home .saved-room .btn { min-height: 40px; padding: 0 18px; border-radius: 12px; font-size: 14px; flex: none; }

#home .home-profile { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; margin: 0; padding: 22px 24px; }
#home .home-profile .avatar-edit { width: 64px; height: 64px; font-size: 22px; font-weight: 800; }
#home .home-profile .avatar-edit:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
#home .home-profile .field.grow { flex: 1 1 140px; }
#home .home-color { flex: 1 1 100%; flex-direction: row; align-items: center; gap: 12px; }
#home .home-color input[type=color] { width: 48px; height: 48px; padding: 3px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-panel); }
#home .home-tip { display: flex; align-items: center; gap: 16px; padding: 18px 22px; }
#home .home-tip img { width: 88px; height: 62px; object-fit: contain; flex: none; }
#home .home-tip p { font-size: 13px; line-height: 1.5; color: var(--muted); }
#home #home-version { text-align: left; margin: 0 4px; color: var(--muted2); }

@media (max-width: 720px) {
  /* The name is required to enter: on phones the profile comes right after the greeting. */
  #home .home-wrap { flex-direction: column; flex-wrap: nowrap; align-items: stretch; padding: 24px 16px; gap: 20px; }
  #home .home-main, #home .home-side { display: contents; }
  #home .home-brand { order: 0; } #home .home-profile { order: 1; } #home .home-join { order: 2; } #home #home-error { order: 3; margin: 0 4px; }
  #home .home-create { order: 4; } #home .home-rooms { order: 5; }
  #home .home-tip, #home #home-version { display: none; }
  #home .home-brand h1 { font-size: 30px; }
  #home .home-row .btn.big { width: 100%; }
}

/* 2.3: a Home segue o layout do Hub do launcher: uma coluna, cumprimento com o mascote, uma linha de código + Entrar + Criar sala,
   salas em fileira. Perfil e senha ficam recolhidos; "Criar sala" abre o bloco de criar. Os ids continuam os de antes. */
#home .home-wrap { max-width: 820px; flex-direction: column; flex-wrap: nowrap; align-items: stretch; padding: 40px 32px 36px; gap: 0; }
#home .home-main { flex: none; gap: 18px; }
#home .home-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
#home .home-brand { flex-direction: row; align-items: center; gap: 14px; margin: 0; }
#home .home-logo { margin: 0; flex: none; }
#home .home-logo img, html.glass #home .home-logo img { width: 52px !important; height: 52px !important; border-radius: 14px; object-fit: cover; }
#home .home-greet { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
#home .home-brand h1 { font-size: 26px; line-height: 1.15; letter-spacing: -.02em; }
#home .home-brand p { font-size: 14px; }
#home .home-profile-d { position: relative; flex: none; }
#home .home-profile-d summary { list-style: none; cursor: pointer; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); user-select: none; }
#home .home-profile-d summary::-webkit-details-marker { display: none; }
#home .home-profile-d summary:hover { color: var(--text-hi); background: var(--hover); }
#home .home-profile-d summary:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
html #home .home-profile-d[open] > .home-profile { background: var(--bg-rail); backdrop-filter: none; }
#home .home-profile-d[open] > .home-profile { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: 300px; box-shadow: 0 18px 44px rgba(0,0,0,.35); }
#home .home-join { gap: 8px; }
#home .home-row { flex-wrap: nowrap; }
#home .home-row .field { flex: 1 1 auto; min-width: 0; }
#home .home-row .btn.big { min-height: 48px; }
#home .home-join .home-more summary, #home .home-join #join-hint { font-size: 12px; }
#home .home-join #join-hint { order: 0; margin: 0; }
#home .home-create[hidden] { display: none; }
#home .home-tip { display: block; padding: 0; font-size: 12px; line-height: 1.5; color: var(--muted); margin: 6px 4px 0; }
/* Novidades: o código e as salas favoritas continuam no topo da home. */
#release-news { order: 5; padding: clamp(12px, 2.6vw, 22px); border: 1px solid var(--line); border-radius: 22px; background: var(--bg-main); color: var(--text-hi); }
.web-viewer #release-news { order: 8; margin-top: 16px; }
#release-news[hidden] { display: none; }
.release-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin: 0 0 14px; }
.release-head h2 { font-size: clamp(20px, 3vw, 26px); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 4px; }
.release-head p, .release-copy p, .release-notes p { margin: 0; line-height: 1.45; }
.release-head p, .release-copy p { font-size: .875rem; }
.release-grid { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; }
.release-grid li { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-panel); color: var(--text-hi); }
.release-grid img { display: block; width: 100%; height: auto; aspect-ratio: 288 / 150; object-fit: cover; }
.release-copy { padding: 10px 12px 12px; overflow-wrap: anywhere; }
.release-copy h3 { font-size: 1rem; line-height: 1.2; margin: 0 0 4px; }
.release-action, .release-dismiss { color: var(--text-hi); border: 1px solid var(--line); border-radius: 10px; background: var(--bg-panel); cursor: pointer; transition: none; }
.release-action { margin-top: 6px; min-height: 36px; padding: 4px 10px; font-size: .875rem; font-weight: 700; }
.release-dismiss { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; }
.release-action:hover, .release-dismiss:hover { border-color: currentColor; }
.release-action:focus-visible, .release-dismiss:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.release-notes { margin: 0; padding-left: 1.2em; display: grid; gap: 10px; }
@media (max-width: 600px) {
  .release-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .release-grid li { display: grid; grid-template-columns: minmax(0, 29%) minmax(0, 1fr); align-items: start; }
  .release-grid img { border-radius: 8px; margin: 10px 0 10px 8px; width: calc(100% - 8px); }
  .release-action { min-height: 44px; }
}
@media (max-width: 720px) {
  #home .home-wrap { padding: 24px 16px; }
  #home .home-top { flex-direction: column; align-items: stretch; }
  #home .home-profile-d[open] > .home-profile { position: static; width: auto; margin-top: 8px; box-shadow: none; }
  #home .home-row { flex-wrap: wrap; }
  #home .home-row .field { flex: 1 1 100%; }
  #home .home-row .btn.big { flex: 1 1 0; width: auto; }
  #home .home-brand h1 { font-size: 24px; }
  #home .home-tip, #home #home-version { display: block; }
}
