/* Landing page — auth/world + full-width stats, game chrome via .ziv-panel */

html:has(body.home-page),
body.home-page {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: auto;
  background: #13171c;
}

.home-page {
  min-height: 100vh;
  margin: 0;
  background: #13171c;
  color: #f2f2f2;
  font-family: Sansation, "Segoe UI", sans-serif;
}

.home-brand {
  text-align: center;
  padding: 28px 16px 8px;
}

.home-brand img {
  display: block;
  margin: 0 auto;
  width: auto;
  height: 120px;
  max-width: min(223px, 80vw);
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 920px;
  margin: 0 auto;
  padding: 16px 20px 40px;
  box-sizing: border-box;
}

body.home-page:not(.home-authed) [data-panel="enter"] {
  display: none !important;
}

body.home-page:not(.home-authed) [data-panel="auth"] {
  grid-column: 1 / -1;
}

@media (max-width: 720px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
}

.home-panel {
  padding: 16px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
}

.home-panel-wide {
  grid-column: 1 / -1;
}

.home-panel[data-panel="info"] {
  height: 800px;
  min-height: 800px;
  max-height: 800px;
}

.home-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.home-panel-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.home-text-link {
  color: #c9a45c;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.home-text-link:hover {
  color: #e0c078;
}

.home-text-link-danger {
  color: #e85a5a;
}

.home-text-link-danger:hover {
  color: #ff7a7a;
}

.home-panel-text {
  margin: 0;
  font-size: 13px;
  opacity: 0.85;
  line-height: 1.35;
}

.home-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.home-field input,
.home-field textarea {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid #67593f;
  border-radius: 4px;
  color: #fff;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
}

.home-field textarea {
  resize: vertical;
  min-height: 72px;
  max-height: 140px;
  line-height: 1.35;
}

.home-field input:focus,
.home-field textarea:focus {
  outline: 1px solid #c9a45c;
}

.home-auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid #67593f;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}

.home-btn:hover {
  background: rgba(0, 0, 0, 0.75);
}

.home-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.home-btn-ghost {
  background: transparent;
}

.home-btn-enter {
  margin-top: auto;
  align-self: stretch;
  background: #2f6b3a;
  border-color: #3f8a4c;
  font-weight: 700;
}

.home-btn-enter:hover {
  background: #378547;
}

.home-btn-enter.is-disabled,
.home-btn-enter[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.4;
  filter: grayscale(0.4);
  cursor: not-allowed;
}

.home-error {
  margin: 0;
  color: #ff8a8a;
  font-size: 12px;
}

.home-auth-user {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-profile-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
}

.home-profile-row > span:first-child {
  opacity: 0.75;
}

.home-profile-nick {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.home-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.home-stats li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.home-stats li span {
  opacity: 0.75;
}

.home-changelog {
  list-style: disc;
  margin: 0;
  padding: 0 0 0 18px;
  display: flex;
  flex-direction: column;
  font-size: 12px;
  line-height: 1.35;
  opacity: 0.85;
}

.home-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #67593f;
  margin: -4px 0 2px;
  flex-shrink: 0;
  overflow: hidden;
}

.home-tab {
  appearance: none;
  margin: 0;
  padding: 6px 14px 8px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  background: transparent;
  color: rgba(242, 242, 242, 0.65);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: -1px;
}

.home-tab:hover {
  color: #e0c078;
}

.home-tab.is-active {
  color: #c9a45c;
  background: rgba(0, 0, 0, 0.35);
  border-color: #67593f;
  border-bottom-color: transparent;
}

.home-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.home-tab-panel[hidden] {
  display: none !important;
}

.home-flood-compose {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.home-flood-compose-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  opacity: 0.8;
}

.home-flood-compose-bar [data-flood-count] {
  margin-right: auto;
}

.home-tab-panel[data-tab-panel="flood"] {
  overflow: hidden;
}

.home-flood-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.home-flood-empty {
  margin: 0;
  font-size: 13px;
  opacity: 0.65;
}

.home-flood-post {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid #67593f;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
}

.home-flood-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.home-flood-nick {
  font-weight: 700;
  color: #c9a45c;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-flood-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.home-flood-date {
  opacity: 0.6;
  white-space: nowrap;
}

.home-flood-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.home-flood-votes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.home-vote {
  appearance: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #67593f;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.45);
  color: #d8c9a4;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.home-vote svg {
  width: 16px;
  height: 16px;
  display: block;
}

.home-vote:hover {
  background: rgba(0, 0, 0, 0.7);
  color: #e0c078;
}

.home-flood-score {
  min-width: 1.5em;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.home-flood-score.is-pos {
  color: #7dce7a;
}

.home-flood-score.is-neg {
  color: #e85a5a;
}

.home-flood-admin {
  display: inline-flex;
  gap: 10px;
}

.hidden {
  display: none !important;
}

.home-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.home-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.home-modal-panel {
  position: relative;
  z-index: 1;
  width: min(360px, 100%);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
}
