/* ── User bar (top-right corner) ── */
#user-bar {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: rgba(0, 0, 0, 0.82);
  border-bottom: 1px solid rgba(140, 255, 149, 0.28);
  border-left: 1px solid rgba(140, 255, 149, 0.28);
  border-bottom-left-radius: 12px;
  font-size: 0.82rem;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--green);
  backdrop-filter: blur(6px);
}

#user-bar img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--green);
  flex-shrink: 0;
}

#user-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-bar-login-btn {
  color: var(--green);
  text-decoration: none;
  border: 1px solid rgba(140, 255, 149, 0.40);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  white-space: nowrap;
  transition: background 0.15s;
}

.user-bar-login-btn:hover {
  background: rgba(140, 255, 149, 0.10);
}

#logout-link {
  color: var(--green);
  text-decoration: none;
  border: 1px solid rgba(140, 255, 149, 0.28);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  transition: background 0.15s;
}

#logout-link:hover {
  background: rgba(140, 255, 149, 0.10);
}

/* ── Shoutbox panel ── */
.shoutbox {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 21/13;
  margin: 0 auto;
  border: 2.5px solid #222;
  border-radius: 18px 18px 28px 28px/18px 18px 38px 38px;
  padding: 16px 18px 18px 18px;
  background: linear-gradient(180deg, #181c18 0%, #232a23 100%);
  box-shadow:
    0 8px 44px rgba(0, 0, 0, 0.42),
    0 0 0 8px #111a,
    0 0 0 2.5px #333,
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 320px;
}

.tv-frame {
  width: 100%;
  max-width: 440px;
  margin: 0 auto 32px auto;
  background: #181c18;
  border-radius: 22px 22px 36px 36px/22px 22px 48px 48px;
  box-shadow: 0 12px 48px #000b, 0 0 0 10px #222b, 0 0 0 2.5px #333;
  padding: 0 0 18px 0;
  position: relative;
}
.tv-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 0 22px;
  height: 48px;
  background: linear-gradient(90deg, #232a23 80%, #2e3c2e 100%);
  border-radius: 22px 22px 0 0/22px 22px 0 0;
  border-bottom: 2px solid #222;
}
.tv-label {
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: 1.18rem;
  color: var(--green);
  letter-spacing: 1.5px;
  text-shadow: 0 2px 8px #000a;
}
.tv-power-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #181c18;
  box-shadow: 0 0 0 2px #333, 0 0 12px 2px #8cff95aa inset;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: box-shadow 0.2s;
}
.tv-power-btn:active {
  box-shadow: 0 0 0 2px #333, 0 0 24px 4px #8cff95cc inset;
}
.tv-power-light {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, #8cff95 60%, #2e3c2e 100%);
  box-shadow: 0 0 12px 4px #8cff95cc, 0 0 2px 1px #fff8;
}
}

.shoutbox-messages {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(140, 255, 149, 0.28) transparent;
}

.shoutbox-msg {
  font-size: 0.86rem;
  line-height: 1.45;
  color: rgba(200, 255, 204, 0.88);
  word-break: break-word;
  padding: 2px 0;
}

.shoutbox-author {
  font-weight: bold;
  color: var(--green);
}

.shoutbox-time {
  font-size: 0.74rem;
  opacity: 0.50;
  margin-left: 5px;
}

.shoutbox-empty {
  font-size: 0.84rem;
  opacity: 0.48;
  text-align: center;
  padding: 14px 0;
}

/* ── Post form ── */
.shoutbox-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.shoutbox-form textarea {
  flex: 1;
  min-height: 50px;
  max-height: 110px;
  resize: vertical;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(140, 255, 149, 0.28);
  border-radius: 10px;
  color: var(--green);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.86rem;
  padding: 8px 10px;
  box-sizing: border-box;
}

.shoutbox-form textarea:focus {
  outline: none;
  border-color: rgba(140, 255, 149, 0.56);
}

.shoutbox-form button {
  padding: 8px 16px;
  background: rgba(140, 255, 149, 0.10);
  border: 1px solid rgba(140, 255, 149, 0.38);
  border-radius: 10px;
  color: var(--green);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.86rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.shoutbox-form button:hover {
  background: rgba(140, 255, 149, 0.20);
}

/* ── Auth prompt (shown to logged-out visitors) ── */
.shoutbox-login-prompt {
  font-size: 0.84rem;
  text-align: center;
  padding: 10px 0;
  color: rgba(140, 255, 149, 0.70);
}

.shoutbox-login-prompt a {
  color: var(--green);
  text-underline-offset: 2px;
}

.shoutbox-status {
  margin-top: 5px;
  font-size: 0.78rem;
  min-height: 1em;
  opacity: 0.72;
}

@media (max-width: 520px) {
  .shoutbox {
    margin-top: 16px;
    padding: 12px 14px;
  }

  .shoutbox-messages {
    max-height: 150px;
  }

  #user-name {
    max-width: 120px;
  }
}
