/* style.css – Backlit 14-Segment LCD / VFD Display System for Play Play */
/* Font faces and animation rules for 'DSEG14 PLAY FONT' live in css/dseg14-play-font.css */

:root {
  --bezel: #0B0F08;
  --bg: #7BB32E;
  --bg-glow: #92D436;
  --bg-edge: #5D8D1E;
  --ink: #122106;
  --ink-shadow: rgba(18, 33, 6, 0.22);
  --ink-dim: rgba(18, 33, 6, 0.42);
  --ink-ghost: rgba(18, 33, 6, 0.065);
  --bar: #0F1C05;
  --yellow: #F6E000;
  --seg-font: 'Departure Mono', 'DSEG14 PLAY FONT', Consolas, 'Cascadia Mono', 'Lucida Console', monospace;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  word-break: keep-all;
  overflow-wrap: normal;
  word-wrap: normal;
  hyphens: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100dvh;
  background-color: var(--bezel);
  color: var(--ink);
  font-family: var(--seg-font);
  font-style: normal;
  font-weight: 400;
  text-transform: uppercase;
  word-break: keep-all;
  overflow-wrap: normal;
  word-wrap: normal;
  hyphens: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

/* Outer housing & backlit LCD panel container */
#app {
  width: 100%;
  max-width: 402px;
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  /* Authentic backlit car-stereo LCD glow: brighter center, deeper olive-green vignette at edges */
  background:
    radial-gradient(ellipse 92% 78% at 50% 46%, var(--bg-glow) 0%, var(--bg) 62%, var(--bg-edge) 100%);
  box-shadow:
    inset 0 0 28px rgba(10, 22, 2, 0.68),
    inset 0 2px 5px rgba(0, 0, 0, 0.55),
    0 0 36px rgba(130, 204, 42, 0.22);
  border-left: 2px solid #1A2412;
  border-right: 2px solid #1A2412;
  overflow: hidden;
}

/* Subtle LCD pixel matrix & glass scanline overlay */
#app::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  background-image:
    linear-gradient(rgba(18, 33, 6, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 33, 6, 0.035) 1px, transparent 1px);
  background-size: 3px 3px;
}

/* Subtle top/bottom LCD bezel shadow + horizontal etched rule line like the stereo display */
#app::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 54px;
  height: 1px;
  background-color: rgba(18, 33, 6, 0.38);
  box-shadow: 0 1px 0 rgba(180, 240, 90, 0.25);
  pointer-events: none;
  z-index: 4;
}

/* Fullscreen stage layout */
.stage {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  z-index: 2;
}

/* Top dark LCD status bar (spans matching horizontal border spacing) */
.top-bar {
  position: absolute;
  top: max(18px, env(safe-area-inset-top, 18px));
  left: 18px;
  right: 18px;
  height: 30px;
  background-color: var(--bar);
  color: var(--bg-glow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-family: var(--seg-font);
  font-style: normal;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.06em;
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.65),
    0 1px 0 rgba(180, 240, 90, 0.35);
  z-index: 5;
}

.top-bar .infinity-btn {
  background: none;
  border: none;
  color: var(--bg-glow);
  font-family: monospace;
  font-size: 20px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  text-shadow: 0 0 6px rgba(146, 212, 54, 0.5);
}

/* Centered narrative / prompt typography (matches top-bar width) */
.center-block {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: max(54px, calc(env(safe-area-inset-top, 18px) + 36px)) 18px 156px 18px;
  max-height: 100dvh;
  box-sizing: border-box;
  overflow-y: auto;
}

.center-block.startup-play-block {
  padding: 0 !important;
  max-height: none !important;
  overflow-y: visible !important;
  text-align: center !important;
  text-align-last: center !important;
}

.prompt-text {
  margin: 0;
  width: 100%;
  max-width: 100%;
  font-family: var(--seg-font);
  font-style: normal;
  font-size: 13.5px;
  line-height: 1.45;
  letter-spacing: 0.03em;
  word-spacing: 0.08em;
  color: var(--ink);
  text-shadow: 1px 1px 0 var(--ink-shadow);
  text-align: center;
  word-break: keep-all;
  overflow-wrap: normal;
  word-wrap: normal;
  white-space: normal;
  hyphens: none;
}

.prompt-text.dimmed {
  color: var(--ink-dim);
  text-shadow: none;
}

/* Conversational typing layout (dimmed prompt at top, active input in center) */
.stage.typing-stage {
  justify-content: flex-start;
  padding-top: calc(max(18px, env(safe-area-inset-top, 18px)) + 66px); /* 36px clearance below top bar (2x of 18px) */
  padding-left: 36px;
  padding-right: 36px;
  padding-bottom: calc(var(--keyboard-inset, 0px) + 128px);
  overflow-y: auto;
}

.typing-top-prompt {
  width: 100%;
  max-width: 100%;
  margin: 0 auto 36px auto;
  font-family: var(--seg-font);
  font-style: normal;
  font-size: 13.5px;
  line-height: 1.45;
  letter-spacing: 0.03em;
  word-spacing: 0.08em;
  color: var(--ink-dim);
  text-align: center;
  word-break: keep-all;
  overflow-wrap: normal;
  word-wrap: normal;
  white-space: normal;
  hyphens: none;
}

.reply-textarea {
  width: 100%;
  max-width: 100%;
  min-height: 28px;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  padding: 0;
  margin: 0 auto;
  font-family: var(--seg-font);
  font-style: normal;
  font-size: 13.5px;
  line-height: 1.45;
  letter-spacing: 0.03em;
  word-spacing: 0.08em;
  color: var(--ink);
  text-shadow: 1px 1px 0 var(--ink-shadow);
  text-transform: none;
  text-align: center;
  caret-color: var(--ink);
  overflow: hidden;
  user-select: text;
  word-break: keep-all;
  overflow-wrap: normal;
  word-wrap: normal;
  white-space: pre-wrap;
  hyphens: none;
}

.reply-textarea::placeholder {
  color: rgba(18, 33, 6, 0.28);
}

/* Reward screen layout (dimmed user quote at top, game response below) */
.stage.reward-stage {
  justify-content: flex-start;
  padding-top: calc(max(18px, env(safe-area-inset-top, 18px)) + 66px);
  padding-left: 36px;
  padding-right: 36px;
  padding-bottom: 170px;
}

.reward-quote {
  width: 100%;
  max-width: 320px;
  margin: 0 auto 48px auto;
  font-family: var(--seg-font);
  font-style: normal;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0.05em;
  word-spacing: 0.12em;
  color: var(--ink-dim);
  text-align: center;
  word-break: keep-all;
  overflow-wrap: normal;
  word-wrap: normal;
}

/* Breathing cadence layout */
.breath-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  text-align: center;
  font-family: var(--seg-font);
  font-style: normal;
  font-size: 17px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-shadow: 1px 1px 0 var(--ink-shadow);
}

.breath-count {
  font-size: 22px;
}

/* Timer display (19:54) with authentic 14-segment unlit ghost backdrop */
.timer-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 24px;
}

.timer-ghost {
  position: absolute;
  inset: 0;
  font-family: var(--seg-font);
  font-style: italic;
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0.06em;
  color: var(--ink-ghost);
  pointer-events: none;
  user-select: none;
}

.timer-digits {
  position: relative;
  font-family: var(--seg-font);
  font-style: italic;
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-shadow: 1.5px 1.5px 0 var(--ink-shadow);
  text-align: center;
}

/* Bottom button stack (270 x 32 px buttons, 13px gap) */
.btn-stack {
  position: absolute;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%);
  width: 278px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  z-index: 5;
}

.btn-primary,
.btn-outline {
  width: 100%;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--seg-font);
  font-style: normal;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0;
  padding: 0 8px;
  transition: opacity 0.12s ease, transform 0.08s ease;
}

.btn-primary {
  background-color: var(--ink);
  color: var(--bg-glow);
  border: 1px solid var(--ink);
  font-size: 14px;
  letter-spacing: 0.06em;
  word-spacing: 0.1em;
  text-shadow: 0 0 6px rgba(146, 212, 54, 0.35);
  box-shadow: 1px 1px 0 var(--ink-shadow);
}

.btn-outline {
  background-color: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  word-spacing: 0.1em;
  text-shadow: 0.8px 0.8px 0 var(--ink-shadow);
  box-shadow: 1px 1px 0 var(--ink-shadow);
}

.btn-primary:active,
.btn-outline:active {
  opacity: 0.78;
  transform: translateY(1px);
}

/* Send button stack on typing screens:
   Rests at the bottom of the screen by default, and hugs the top of the mobile
   phone keyboard when it appears (tracked via window.visualViewport). */
.btn-stack.typing-send-stack {
  bottom: 72px;
  transition: bottom 0.08s ease-out;
  z-index: 15;
}

.stage.typing-stage.keyboard-open .btn-stack.typing-send-stack {
  position: fixed;
  bottom: calc(var(--keyboard-inset, 0px) + 10px);
}

/* ==========================================================================
   LCD TERMINAL UI: Top Bar Actions, Sidebar (Open / Docked),
   Playlist Tabs (TRACKS / MY PLAYLIST), and Notes List
   ========================================================================== */

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.top-bar-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.gb-icon-btn {
  background: transparent;
  border: 1px solid rgba(146, 212, 54, 0.45);
  color: var(--bg-glow);
  height: 22px;
  min-width: 24px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: var(--seg-font);
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.gb-icon-btn:active,
.gb-icon-btn.active {
  background: var(--bg-glow);
  color: var(--ink);
}

.gb-icon-btn svg {
  width: 13px;
  height: 13px;
  display: block;
}

/* Openable & Dockable Sidebar Navigation */
.lcd-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 33, 6, 0.35);
  z-index: 18;
}

.lcd-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  height: 100dvh;
  width: 210px;
  background: var(--ink);
  color: var(--bg-glow);
  border-right: 2px solid var(--bg-glow);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 20;
  box-shadow: 4px 0 0 rgba(18, 33, 6, 0.35);
}

.stage.sidebar-docked {
  padding-left: 162px;
}

.stage.sidebar-docked .lcd-sidebar {
  width: 148px;
  box-shadow: none;
}

.lcd-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lcd-sidebar-header {
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 0.7;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(146, 212, 54, 0.3);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lcd-sidebar-link {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--bg-glow);
  border: 1px solid rgba(146, 212, 54, 0.35);
  padding: 9px 8px;
  font-family: var(--seg-font);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lcd-sidebar-link.active,
.lcd-sidebar-link:active {
  background: var(--bg-glow);
  color: var(--ink);
  font-weight: 700;
}

.lcd-sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(146, 212, 54, 0.3);
}

.lcd-sidebar-logout-btn {
  opacity: 0.8;
  font-size: 10.5px;
  border-color: rgba(146, 212, 54, 0.25);
}

.lcd-sidebar-logout-btn:hover,
.lcd-sidebar-logout-btn:active {
  background: rgba(146, 212, 54, 0.2);
  color: var(--bg-glow);
}

/* Mission Control Status Pill */
.mc-bridge-pill {
  border: 1.5px solid var(--ink);
  background: rgba(18, 33, 6, 0.1);
  padding: 6px 10px;
  font-size: 11px;
  line-height: 1.45;
  letter-spacing: 0.05em;
  max-width: 320px;
  text-align: center;
  box-shadow: 1px 1px 0 var(--ink-shadow);
}

/* Playlist & Notes List Stage */
.stage.list-stage {
  justify-content: flex-start;
  padding-top: calc(max(18px, env(safe-area-inset-top, 18px)) + 66px);
  padding-bottom: 150px;
  overflow-y: auto;
}

/* Playlist Page Tabs: TRACKS | MY PLAYLIST */
.lcd-tabs {
  width: 100%;
  max-width: 340px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 2px solid var(--ink);
  margin-bottom: 12px;
  box-shadow: 2px 2px 0 var(--ink-shadow);
  flex-shrink: 0;
}

.lcd-tab-btn {
  height: 34px;
  background: transparent;
  color: var(--ink);
  border: none;
  font-family: var(--seg-font);
  font-size: 12px;
  letter-spacing: 0.06em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lcd-tab-btn + .lcd-tab-btn {
  border-left: 2px solid var(--ink);
}

.lcd-tab-btn.active {
  background: var(--ink);
  color: var(--bg-glow);
}

/* Terminal List for Tracks, My Playlist, and Notes */
.lcd-list {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 2px;
}

.lcd-list-item {
  width: 100%;
  text-align: left;
  background: rgba(18, 33, 6, 0.08);
  border: 1.5px solid var(--ink);
  color: var(--ink);
  padding: 10px 12px;
  font-family: var(--seg-font);
  font-size: 12.5px;
  line-height: 1.45;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: 1.5px 1.5px 0 var(--ink-shadow);
}

.lcd-list-item:active {
  background: var(--ink);
  color: var(--bg-glow);
}

.lcd-list-item-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lcd-list-item-meta {
  font-size: 10.5px;
  color: var(--ink-dim);
  letter-spacing: 0.05em;
}

.lcd-empty-state {
  width: 100%;
  max-width: 320px;
  border: 1.5px dashed var(--ink);
  padding: 20px 14px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.55;
  letter-spacing: 0.05em;
  color: var(--ink);
  margin: 12px auto;
}

/* Opened Note detail screen */
.stage.notebook-stage {
  justify-content: flex-start;
  padding-top: calc(max(18px, env(safe-area-inset-top, 18px)) + 66px);
  padding-left: 36px;
  padding-right: 36px;
  padding-bottom: 155px;
}

.notebook-header-card {
  width: 100%;
  max-width: 330px;
  border: 2px solid var(--ink);
  background: rgba(18, 33, 6, 0.1);
  padding: 10px 12px;
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: 0.06em;
  box-shadow: 2px 2px 0 var(--ink-shadow);
}

.notebook-comment {
  width: 100%;
  max-width: 326px;
  margin: 22px auto 0 auto;
  font-family: var(--seg-font);
  font-style: normal;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0.05em;
  word-spacing: 0.12em;
  color: var(--ink);
  text-shadow: 1px 1px 0 var(--ink-shadow);
  text-align: center;
  text-transform: none;
  word-break: keep-all;
  overflow-wrap: normal;
  word-wrap: normal;
}

/* Auth Modal Dialog & Reward Charm & Timer Cycle Helpers */
.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 15, 8, 0.78);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-modal {
  width: 100%;
  max-width: 340px;
  background: var(--bg);
  border: 2px solid var(--ink);
  box-shadow: 0 0 24px rgba(18, 33, 6, 0.5), inset 0 0 16px rgba(18, 33, 6, 0.15);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.auth-input {
  width: 100%;
  border: 2px solid var(--ink);
  background: rgba(18, 33, 6, 0.08);
  color: var(--ink);
  font-family: var(--seg-font);
  font-size: 13.5px;
  padding: 8px 10px;
  text-align: center;
  text-transform: none;
  outline: none;
}

/* Unlocked casing for user input, typing mirror, notes, auth inputs, and emulator preview */
.reply-textarea,
.reply-mirror,
.reply-mirror *,
.reply-mirror .dseg-char::after,
.notebook-comment,
.auth-input,
.emulator-preview-text,
.emulator-preview-text *,
.emulator-preview-text .dseg-char::after {
  text-transform: none !important;
}

.timer-cycle-hint {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin-top: 14px;
  text-align: center;
  line-height: 1.45;
}

.reward-charm-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px auto 10px auto;
}

/* ==========================================================================
   User Settings Feature: Justified Text Alignment Toggle
   Active when root has data-text-align="justify" (configured in user settings)
   ========================================================================== */
[data-text-align="justify"] .center-block:not(.startup-play-block) {
  text-align: justify;
  text-justify: inter-word;
  text-align-last: left;
}

[data-text-align="justify"] .prompt-text:not(.startup-play-block .prompt-text),
[data-text-align="justify"] .typing-top-prompt,
[data-text-align="justify"] .reply-textarea,
[data-text-align="justify"] .reward-quote,
[data-text-align="justify"] .notebook-comment {
  text-align: justify;
  text-justify: inter-word;
  text-align-last: left;
}

/* ==========================================================================
   Play Play Text Emulator & Local Video Studio
   ========================================================================== */
.stage.emulator-preview-stage {
  padding-top: calc(max(18px, env(safe-area-inset-top, 18px)) + 66px);
  padding-left: 32px;
  padding-right: 32px;
  padding-bottom: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.stage.emulator-duration-stage {
  padding-top: calc(max(18px, env(safe-area-inset-top, 18px)) + 66px);
  padding-left: 24px;
  padding-right: 24px;
  padding-bottom: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.emulator-card {
  width: 100%;
  max-width: 360px;
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.emulator-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  width: 100%;
  margin: 6px 0;
}

.emulator-pill {
  background: transparent;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  font-family: var(--seg-font);
  font-size: 11.5px;
  padding: 8px 14px;
  cursor: pointer;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.emulator-pill.active {
  background: var(--ink);
  color: var(--bg-glow);
  font-weight: 700;
}

.emulator-progress-box {
  width: 100%;
  max-width: 340px;
  border: 2px solid var(--ink);
  background: rgba(18, 33, 6, 0.06);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  box-shadow: 2px 2px 0 var(--ink-shadow);
  margin: auto 0;
}

.emulator-progress-bar {
  width: 100%;
  height: 18px;
  border: 1.5px solid var(--ink);
  background: rgba(18, 33, 6, 0.12);
  overflow: hidden;
  position: relative;
}

.emulator-progress-fill {
  height: 100%;
  background: var(--ink);
  width: 0%;
  transition: width 0.1s linear;
}

.emulator-preview-box {
  width: 100%;
  max-width: 360px;
  border: 2px solid var(--ink);
  background: rgba(18, 33, 6, 0.04);
  padding: 24px 20px;
  margin: auto 0;
  box-shadow: 2px 2px 0 var(--ink-shadow);
  text-align: center;
}




