/* Pong layout notes:
   - Update sizes in .layout (game/sidebar widths)
   - Guestbook height uses --guestbook-pane-height
   - Idle fade timing handled in pong.js */
html, body {
        margin: 0;
        background: #0b0b0b;
        color: #fff;
        font-family: "Courier New", monospace;
        min-height: 100vh;
      }
body {
        margin: 0;
        background: #0b0b0b;
        color: #fff;
        font-family: "Courier New", monospace;
        min-height: 100vh;
      }
.pong-back {
        display: none;
        position: fixed;
        top: 10px;
        right: 12px;
        z-index: 50;
        color: #fff;
        text-decoration: none;
        font-size: 28px;
        line-height: 1;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 999px;
        width: 36px;
        height: 36px;
        align-items: center;
        justify-content: center;
      }
      .pong-back:hover {
        background: rgba(255, 255, 255, 0.1);
      }
      .layout {
        --game-width: 720px;
        --sidebar-width: 400px;
        --gap: 20px;
        --layout-width: calc(var(--game-width) + var(--sidebar-width) + var(--gap));
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding: 20px;
        box-sizing: border-box;
      }
      .wrapper {
        width: 100%;
        max-width: var(--layout-width);
        display: grid;
        grid-template-columns: var(--game-width) var(--sidebar-width);
        gap: var(--gap);
        align-items: start;
      }
      .left-column {
        display: flex;
        flex-direction: column;
        gap: 12px;
        align-items: center;
        width: var(--game-width);
      }
      canvas {
        background: #111;
        border: 2px solid #fff;
        display: block;
        margin: 0;
      }
      .hint {
        font-size: 14px;
        opacity: 0.8;
        margin-top: 12px;
        text-align: center;
      }
      .game-panel {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: relative;
      }
      .sidebar {
        width: var(--sidebar-width);
        background: #0f1118;
        border: 2px solid #fff;
        padding: 12px;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-self: flex-start;
        overflow: hidden;
        justify-self: end;
      }
      .guestbook-panel {
        width: 100%;
        max-width: var(--layout-width);
        background: transparent;
        border: 2px solid #fff;
        padding: 12px;
        box-sizing: border-box;
        position: relative;
        overflow: hidden;
        --guestbook-pane-height: 300px;
      }
.guestbook-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
  column-gap: var(--gap);
  row-gap: 12px;
  align-items: start;
  width: 100%;
  opacity: 1;
  transition: opacity 10s ease;
}
      .guestbook-feed,
      .comment-form {
        background: rgba(15, 17, 24, 0.7);
        padding: 8px 14px;
        border-radius: 8px;
        min-height: var(--guestbook-pane-height);
        box-sizing: border-box;
      }
      .guestbook-squiggles {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        border: 0;
        opacity: 0;
        transition: opacity 0.6s ease;
        pointer-events: none;
      }
      .guestbook-panel.is-idle .guestbook-content {
        opacity: 0;
        pointer-events: none;
      }
.guestbook-panel.is-idle.is-form-hover .guestbook-content {
  opacity: 0.9;
  pointer-events: auto;
  transition: opacity 0.25s ease;
}
.guestbook-panel:not(.is-idle) .guestbook-content {
  transition: opacity 0.25s ease;
}
      .guestbook-panel.is-form-hover .guestbook-content {
        opacity: 0.9;
      }
      .guestbook-panel.is-idle .guestbook-squiggles {
        opacity: 1;
      }
      .guestbook-panel:not(.is-idle) .guestbook-squiggles {
        opacity: 1;
      }
      .guestbook-feed {
        width: 100%;
      }
      .guestbook-panel h2 {
        margin: 0 0 8px;
        font-size: 16px;
        letter-spacing: 1px;
        text-transform: uppercase;
      }
      .sidebar h2 {
        margin: 0;
        font-size: 16px;
        letter-spacing: 1px;
        text-transform: uppercase;
      }
      .guestbook-title {
        margin: 0 0 6px;
        font-size: 16px;
        letter-spacing: 1px;
        text-transform: uppercase;
      }
      .comment-form {
        align-self: start;
        justify-self: stretch;
        width: 100%;
        max-width: none;
        height: var(--guestbook-pane-height);
      }
      .leaderboard {
        display: flex;
        flex-direction: column;
        gap: 4px;
        font-size: 13px;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding-right: 4px;
      }
      .leaderboard-item {
        display: flex;
        gap: 8px;
        align-items: flex-start;
      }
      .leaderboard-rank {
        min-width: 28px;
        opacity: 0.7;
      }
      .leaderboard-details {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 4px;
      }
      .leaderboard-line {
        display: flex;
        justify-content: space-between;
        gap: 8px;
      }
      .leaderboard-name,
      .leaderboard-score {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .leaderboard-meta {
        font-size: 10px;
        opacity: 0.7;
        line-height: 1.4;
        word-break: break-word;
      }
      .comments {
        height: 310px;
        overflow-y: auto;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        padding: 10px 0;
        background: rgba(21, 24, 35, 0.7);
        border-radius: 6px;
      }
      .comment {
        margin-bottom: 10px;
        font-size: 14px;
        line-height: 1.6;
        padding-top: 0;
        margin-top: 0;
        border-top: 0;
      }
      .comment:first-child {
        padding-top: 0;
        margin-top: 0;
        border-top: 0;
      }
      .comment + .comment {
        padding-top: 8px;
        margin-top: 8px;
      }
      .comment + .comment::before {
        content: "";
        display: block;
        height: 8px;
        background: rgba(0, 0, 0, 0.18);
        margin-bottom: 8px;
      }
      .comment .meta {
        opacity: 0.7;
        font-size: 12px;
        margin-bottom: 4px;
      }
      .comment-form label {
        display: block;
        font-size: 11px;
        margin-bottom: 6px;
      }
      .comment-form input,
      .comment-form textarea {
        width: 100%;
        padding: 6px 8px;
        margin-bottom: 6px;
        border-radius: 6px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        background: rgba(21, 24, 35, 0.7);
        color: #fff;
        font-family: "Courier New", monospace;
        box-sizing: border-box;
      }
      .score-form input,
      .prompt-form input {
        width: 100%;
        padding: 6px 8px;
        margin-bottom: 6px;
        border-radius: 6px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        background: #151823;
        color: #fff;
        font-family: "Courier New", monospace;
        box-sizing: border-box;
      }
      .comment-form textarea {
        height: 167px;
      }
      #guestPromptComment {
        width: 355px;
        max-width: 100%;
      }
      .comment-form button,
      .score-form button,
      .prompt-form button {
        width: 100%;
        padding: 6px 8px;
        border: 1px solid #fff;
        background: #fff;
        color: #111;
        font-weight: bold;
        cursor: pointer;
        font-size: 12px;
      }
      .prompt-form button + button {
        margin-top: 6px;
      }
      .status {
        font-size: 12px;
        opacity: 0.8;
        min-height: 16px;
        margin-top: 6px;
      }
      @media (max-width: 880px) {
        .wrapper {
          grid-template-columns: 1fr;
        }
        .left-column {
          width: 100%;
          align-items: center;
        }
        .guestbook-panel {
          max-width: 100%;
        }
        .guestbook-content {
          grid-template-columns: 1fr;
        }
      }
@media (max-width: 760px) {
        html, body {
          height: 100%;
          overflow: hidden;
        }
        body {
          overflow: hidden;
        }
        .wrapper {
          display: none;
        }
        .guestbook-panel {
          width: 100%;
          max-width: 100%;
          height: 100dvh;
          padding-bottom: calc(24px + env(safe-area-inset-bottom));
          box-sizing: border-box;
          border: 0;
        }
        .guestbook-content {
          display: flex;
          flex-direction: column;
          height: 100%;
          row-gap: 12px;
        }
        .guestbook-feed {
          order: 1;
          flex: 1 1 auto;
          min-height: 0;
          overflow: hidden;
        }
        .comment-form {
          order: 2;
          max-width: none;
          justify-self: stretch;
          display: flex;
          flex-direction: column;
          flex: 0 0 auto;
          max-height: 34vh;
        }
        .comment-form,
        .guestbook-feed {
          box-sizing: border-box;
        }
        .comment-form textarea {
          height: 90px;
          font-size: 16px;
        }
        .comment-form input {
          font-size: 16px;
        }
        .comment-form button {
          margin-top: auto;
        }
        .comments {
          height: auto;
          max-height: 100%;
        }
      }
      .pause-overlay,
      .prompt-overlay {
        position: absolute;
        inset: 0;
        display: none;
        align-items: center;
        justify-content: center;
        background: rgba(5, 6, 11, 0.75);
        color: #fff;
        text-align: center;
        padding: 20px;
        box-sizing: border-box;
        flex-direction: column;
        gap: 10px;
      }
      .pause-overlay.is-visible,
      .prompt-overlay.is-visible {
        display: flex;
      }
      .prompt-panel {
        width: 100%;
        max-width: 320px;
        background: #0f1118;
        border: 2px solid #fff;
        padding: 14px;
      }
      .prompt-panel h3 {
        margin: 0 0 10px;
        font-size: 16px;
        text-transform: uppercase;
      }
      .guestbook-overlay .prompt-panel {
        max-width: 360px;
        width: 360px;
      }
      .pause-overlay .paused-title {
        font-size: 28px;
        letter-spacing: 2px;
        text-transform: uppercase;
      }
      .pause-overlay .paused-sub {
        font-size: 14px;
        opacity: 0.8;
        max-width: 320px;
      }
