/* ==========================================================================
   PIXTECH / 像素科技 - Regional Access Deny Page
   Pure One-Screen Scene Architecture (Zero Vertical / Horizontal Scroll)
   ========================================================================== */

:root {
  --bg: #121316;
  --bg-canvas: #0c0d10;
  
  --text: #f1f1ee;
  --muted: #94979e;
  --muted-dim: #5c5f66;
  
  --accent: #21d4e8;
  --accent-score: #28b5c6; /* Subdued, refined cyan for scores */
  --warm: #e5ded3;
  
  --border: rgba(241, 241, 238, 0.08);
  --border-subtle: rgba(241, 241, 238, 0.04);
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Consolas, monospace;
}

/* Global Reset & Strict Single Screen Constraints */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  -webkit-user-select: none;
}

body {
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
}

#app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: clamp(14px, 2.5vmin, 36px) clamp(16px, 3.5vmax, 56px);
  overflow: hidden;
}

/* ==========================================================================
   Top Bar: Minimal Brand & Editorial 403
   ========================================================================== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  height: clamp(26px, 3.8vh, 38px);
  margin-bottom: clamp(8px, 2vh, 24px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Geometric Minimalist Pixel Mark */
.pixel-p {
  width: 16px;
  height: 20px;
  display: grid;
  grid-template-columns: repeat(3, 4px);
  grid-template-rows: repeat(4, 4px);
  gap: 1.5px;
}

.p-dot {
  width: 4px;
  height: 4px;
  background-color: var(--text);
  border-radius: 0.5px;
}

.p-dot.p-accent {
  background-color: var(--accent);
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-title {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
}

.brand-sub {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.status-code {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text);
  opacity: 0.85;
}

/* ==========================================================================
   Main Scene (2 Columns on Desktop)
   ========================================================================== */
.scene {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(440px, 1.35fr);
  gap: clamp(20px, 3.5vw, 48px);
  align-items: stretch;
}

/* Left Column: Notice Area (Shifted ~9% Viewport Height Upwards) */
.notice-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  padding-right: clamp(0px, 1.5vw, 16px);
}

.notice-content {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.6vh, 18px);
  transform: translateY(-9vh); /* Shifted up by ~9vh to improve bottom negative space */
}

.notice-title {
  font-family: var(--font-sans);
  font-size: clamp(26px, 3.6vw, 44px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
}

.notice-desc {
  font-family: var(--font-sans);
  font-size: clamp(14px, 1.25vw, 16.5px);
  line-height: 1.65;
  color: var(--warm);
  opacity: 0.9;
}

.notice-sub {
  font-family: var(--font-sans);
  font-size: clamp(12.5px, 1.1vw, 14px);
  line-height: 1.55;
  color: var(--muted);
}

.notice-action {
  margin-top: clamp(6px, 1.2vh, 14px);
}

/* Enhanced Clickable Affordance for Retry Action */
.btn-reload {
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: underline;
  text-decoration-color: rgba(148, 151, 158, 0.4);
  text-underline-offset: 4px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease, transform 0.15s ease;
}

.btn-reload:hover {
  color: var(--text);
  text-decoration-color: var(--accent);
  transform: translateY(-1px);
}

.btn-reload:active {
  transform: translateY(0);
}

/* ==========================================================================
   Right Column: Game Window (Direct Hero Canvas - No Outer Card Box)
   ========================================================================== */
.game-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  height: 100%;
}

/* Minimal Game HUD Floating Directly Above Canvas */
.game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  height: 22px;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: clamp(11.5px, 1.1vw, 12.5px);
  color: var(--muted);
}

.game-title {
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
  font-size: 12px;
}

.game-scores {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.score-group strong {
  color: var(--accent-score);
  font-weight: 700;
  margin-left: 3px;
}

.score-sep {
  color: var(--border);
  margin: 0 2px;
}

/* Canvas Viewport */
.canvas-wrapper {
  flex: 1;
  min-height: 0;
  width: 100%;
  position: relative;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
  background-color: var(--bg-canvas);
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  -webkit-touch-callout: none;
  cursor: pointer;
}

.noscript-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  background: var(--bg-canvas);
}

/* Controls Hint Floating Directly Below Canvas */
.game-prompt {
  flex-shrink: 0;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-align: center;
}

/* ==========================================================================
   Height-First Adaptive Rules (1366x768, 1280x720, 600px, etc.)
   ========================================================================== */

@media (max-height: 760px) {
  #app {
    padding: clamp(10px, 2vh, 18px) clamp(14px, 3vw, 32px);
  }
  .top-bar {
    margin-bottom: 10px;
  }
  .notice-content {
    transform: translateY(-7vh);
  }
  .notice-title {
    font-size: clamp(22px, 3.8vh, 32px);
  }
}

@media (max-height: 640px) {
  #app {
    padding: 8px 16px;
  }
  .top-bar {
    margin-bottom: 6px;
    height: 24px;
  }
  .notice-content {
    transform: translateY(-4vh);
  }
  .notice-title {
    font-size: 22px;
  }
  .notice-desc {
    font-size: 13px;
  }
  .notice-sub {
    font-size: 11.5px;
  }
}

/* ==========================================================================
   Mobile (Portrait) Adaptive Layout (Zero Scroll Guaranteed)
   ========================================================================== */

@media (max-width: 768px) and (orientation: portrait) {
  #app {
    padding: clamp(10px, 1.8vh, 16px) clamp(10px, 3vw, 18px);
  }

  .top-bar {
    margin-bottom: clamp(6px, 1.2vh, 12px);
    height: 26px;
  }

  .scene {
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1.4vh, 12px);
    flex: 1;
    min-height: 0;
  }

  /* Top Section: Notice */
  .notice-col {
    flex-shrink: 0;
    justify-content: flex-start;
    padding-right: 0;
  }

  .notice-content {
    margin: 0;
    gap: 4px;
    transform: none; /* No vertical shift in portrait mobile */
  }

  .notice-title {
    font-size: clamp(20px, 5.5vw, 26px);
    line-height: 1.2;
  }

  .notice-desc {
    font-size: clamp(13px, 3.5vw, 14.5px);
    line-height: 1.45;
  }

  .notice-sub {
    font-size: clamp(11.5px, 3.1vw, 12.5px);
  }

  .notice-action {
    display: none;
  }

  /* Middle Section: Hero Game */
  .game-col {
    flex: 1;
    min-height: 0;
  }

  .game-hud {
    height: 20px;
    margin-bottom: 5px;
    font-size: 11px;
  }

  .game-title {
    font-size: 11px;
  }

  .game-prompt {
    height: 16px;
    margin-top: 4px;
    font-size: 10.5px;
  }
}

/* Compact Mobile Mode (< 680px height like iPhone SE 2/3, iPhone 8) */
@media (max-width: 768px) and (max-height: 680px) and (orientation: portrait) {
  #app {
    padding: 8px 12px;
  }

  .top-bar {
    margin-bottom: 4px;
  }

  .notice-sub {
    display: none;
  }

  .notice-title {
    font-size: 19px;
  }

  .notice-desc {
    font-size: 12.5px;
  }
}

/* Extra Compact Mode (< 580px height like iPhone SE 1: 320x568) */
@media (max-width: 768px) and (max-height: 580px) and (orientation: portrait) {
  #app {
    padding: 6px 8px;
  }

  .top-bar {
    margin-bottom: 3px;
  }

  .brand-sub {
    display: none;
  }

  .notice-title {
    font-size: 17px;
  }

  .notice-desc {
    font-size: 12px;
  }
}

/* Narrow Phone (< 360px width) Specific Rule */
@media (max-width: 360px) {
  .game-title {
    display: none;
  }
  .score-sep {
    display: none;
  }
  .game-scores {
    width: 100%;
    justify-content: space-between;
    font-size: 11px;
  }
}

/* ==========================================================================
   Mobile Landscape Mode (e.g. 844x390, 852x393, 915x412)
   ========================================================================== */

@media (max-height: 500px) and (orientation: landscape) {
  #app {
    padding: 6px 14px;
  }

  .top-bar {
    height: 22px;
    margin-bottom: 4px;
  }

  .brand-sub {
    display: none;
  }

  .scene {
    display: grid;
    grid-template-columns: minmax(190px, 0.75fr) minmax(300px, 1.25fr);
    gap: 14px;
  }

  .notice-content {
    gap: 3px;
    transform: translateY(-2vh);
  }

  .notice-title {
    font-size: 18px;
  }

  .notice-desc {
    font-size: 11.5px;
  }

  .notice-sub,
  .notice-action {
    display: none;
  }

  .game-hud {
    height: 18px;
    margin-bottom: 4px;
    font-size: 11px;
  }

  .game-prompt {
    height: 14px;
    margin-top: 3px;
    font-size: 9.5px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
