/* Purrgatory Panic v1.0.0 — shell chrome follows Cryptic Conclave cyan. */
[hidden] { display: none !important; }

.pp-shell { max-width: 1280px; }
.pp-intro { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 16px; }
.pp-intro-copy { margin: 0; color: #b6dce3; max-width: 66ch; line-height: 1.5; }
.pp-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pp-button,
.pp-name-field input,
.pp-pause-button {
  font: inherit;
  border: 1px solid #00cccc;
  border-radius: 5px;
  background: linear-gradient(160deg, rgba(0, 54, 68, .94), rgba(4, 20, 34, .94));
  color: #d9ffff;
  padding: 9px 14px;
  cursor: url('/images/cursors/hover.cur') 11 0, url('/images/cursors/hover.png') 11 0, pointer;
}
.pp-button:hover,
.pp-button:focus-visible,
.pp-pause-button:hover,
.pp-pause-button:focus-visible { background: linear-gradient(160deg, rgba(0, 106, 112, .95), rgba(5, 30, 45, .96)); color: #fff; }
.pp-button--primary { border-color: #b178ff; box-shadow: 0 0 18px rgba(177, 120, 255, .28); }
.pp-button[disabled] { opacity: .45; cursor: not-allowed; }
.pp-name-field { display: inline-flex; align-items: center; gap: 8px; color: #b9eef1; font-weight: 600; }
.pp-name-field input { width: 170px; padding: 8px 10px; }
.pp-name-field input:focus-visible { outline: 2px solid #f2d77b; outline-offset: 2px; }
.pp-game-surface {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0, 204, 204, .65);
  border-radius: 10px;
  background: #070a19;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45), inset 0 0 55px rgba(0, 204, 204, .08);
}
.pp-canvas-wrap { position: relative; min-height: 490px; aspect-ratio: 12 / 7; max-height: 690px; }
#gameCanvas { display: block; width: 100%; height: 100%; min-height: 490px; touch-action: none; image-rendering: auto; }
.pp-hud { position: absolute; inset: 12px 14px auto; display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; pointer-events: none; }
.pp-hud__stats { display: flex; flex-wrap: wrap; gap: 7px; max-width: 80%; }
.pp-stat { display: grid; gap: 1px; min-width: 78px; padding: 6px 10px; border: 1px solid rgba(113, 231, 232, .36); border-radius: 6px; background: rgba(5, 11, 28, .84); backdrop-filter: blur(3px); }
.pp-stat span { font-size: .72rem; color: #92b9c8; text-transform: uppercase; letter-spacing: .08em; }
.pp-stat strong { color: #ebffff; font-size: 1.1rem; }
.pp-hud__buttons { display: flex; gap: 7px; pointer-events: auto; }
.pp-hud__buttons button { padding: 7px 10px; }
.pp-shift-hint { position: absolute; left: 14px; bottom: 12px; margin: 0; color: #a9cad2; font-size: .85rem; text-shadow: 0 1px 3px #000; }
.pp-status { min-height: 1.45em; margin: 9px 3px 0; color: #b5e3eb; }
.pp-status[data-tone="good"] { color: #86f0bc; }
.pp-status[data-tone="warn"] { color: #ffbd9e; }
.pp-status[data-tone="hint"] { color: #c9d3ff; }
.pp-pause-banner { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; background: rgba(3, 6, 18, .68); backdrop-filter: blur(4px); }
.pp-pause-card,
.pp-round-card { width: min(460px, calc(100% - 32px)); padding: 24px; border: 1px solid #70e7e8; border-radius: 10px; background: rgba(8, 17, 38, .95); text-align: center; box-shadow: 0 12px 45px rgba(0, 0, 0, .54); }
.pp-pause-card h2, .pp-round-card h2 { margin-top: 0; color: #d9ffff; }
.pp-pause-card p, .pp-round-card p { color: #b4d3da; }
.pp-round-overlay { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(4, 7, 18, .73); }
.pp-round-card { border-color: #c29aff; }
.pp-round-card .pp-button { margin-top: 10px; }
.pp-divider { margin: 24px 0 15px; border: 0; border-top: 1px solid rgba(0, 204, 204, .35); }
.leaderboard { overflow-x: auto; }
.leaderboard h2 { margin-top: 0; }
#lbTable { width: 100%; min-width: 680px; border-collapse: collapse; border: 1px solid #008b8b; background: rgba(4, 12, 26, .55); }
#lbTable th, #lbTable td { padding: 8px 10px; border: 1px solid rgba(0, 139, 139, .7); text-align: left; }
#lbTable th { background: rgba(0, 204, 204, .14); color: #aefefe; }
#lbTable td { color: #c8e5e8; }
#lbTable .empty-cell { color: #8ba9ae; font-style: italic; text-align: center; }

@media (max-width: 850px) {
  .pp-intro { align-items: flex-start; flex-direction: column; }
  .pp-name-field input { width: 145px; }
  .pp-canvas-wrap, #gameCanvas { min-height: 420px; }
  .pp-hud { inset: 8px; }
  .pp-stat { min-width: 64px; padding: 5px 7px; }
  .pp-stat span { font-size: .63rem; }
  .pp-stat strong { font-size: .96rem; }
}

/* Phone landscape is a dedicated one-viewport play mode. The shared gate's
   mobile-landscape-ready opt-in admits this game without changing other games. */
@media (orientation: landscape) and (min-width: 568px) and (max-width: 920px) {
  html,
  body { overflow: hidden; }

  .wrapper {
    width: 100%;
    height: 100svh;
    min-height: 0;
  }

  .wrapper > header,
  .wrapper > footer,
  .back-link,
  .game-info,
  .cc-htp-bar,
  .cc-ach-bar,
  .cc-bug-bar,
  .cc-krix-cameo,
  .pp-intro-copy,
  .pp-divider,
  .leaderboard,

  main {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
  }

  .container.pp-shell {
    box-sizing: border-box;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    height: 100svh;
    min-height: 0;
    max-width: none;
    margin: 0;
    padding: max(4px, env(safe-area-inset-top, 0px))
      max(6px, env(safe-area-inset-right, 0px))
      max(4px, env(safe-area-inset-bottom, 0px))
      max(6px, env(safe-area-inset-left, 0px));
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .pp-intro {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    margin: 0 0 4px;
  }

  .pp-controls {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 6px;
  }

  .pp-name-field {
    gap: 5px;
    font-size: .72rem;
    white-space: nowrap;
  }

  .pp-name-field input {
    box-sizing: border-box;
    width: clamp(112px, 24vw, 158px);
    min-height: 36px;
    padding: 6px 8px;
    font-size: .78rem;
  }

  .pp-button--primary {
    min-height: 36px;
    padding: 6px 9px;
    font-size: .72rem;
    white-space: nowrap;
  }

  .pp-game-surface {
    flex: 1 1 auto;
    min-height: 0;
    border-radius: 7px;
  }

  .pp-canvas-wrap,
  #gameCanvas {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    aspect-ratio: auto;
  }

  .pp-status { display: none; }

  .pp-hud {
    inset: 4px 5px auto;
    align-items: flex-start;
    gap: 4px;
  }

  .pp-hud__stats {
    flex-wrap: nowrap;
    gap: 3px;
    max-width: calc(100% - 138px);
  }

  .pp-stat {
    min-width: 0;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1.2;
  }

  .pp-stat span {
    font-size: clamp(.48rem, 1.4vw, .58rem);
    letter-spacing: .035em;
  }

  .pp-stat strong { font-size: clamp(.68rem, 1.8vw, .83rem); }

  .pp-hud__buttons { gap: 3px; }
  .pp-hud__buttons button {
    min-height: 32px;
    padding: 3px 5px;
    font-size: clamp(.58rem, 1.55vw, .72rem);
    white-space: nowrap;
  }

  .pp-shift-hint {
    left: 7px;
    bottom: 4px;
    max-width: calc(100% - 14px);
    overflow: hidden;
    font-size: .62rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .pp-pause-card,
  .pp-round-card {
    box-sizing: border-box;
    max-height: calc(100% - 16px);
    padding: 12px;
    overflow: auto;
  }

  .pp-pause-card h2,
  .pp-round-card h2 { margin-bottom: 4px; }

  .pp-pause-card p,
  .pp-round-card p { margin: 4px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pp-game-surface { box-shadow: inset 0 0 35px rgba(0, 204, 204, .08); }
}
