/* ==========================================================================
   GUESS THE WORD - DESKTOP & MOBILE RESPONSIVE DARK THEME
   ========================================================================== */

:root {
  --bg-app: #080a0f;
  --paper-bg: #141824;
  --paper-line: rgba(148, 163, 184, 0.08);
  --paper-margin: transparent;
  --ink-color: #f1f5f9;
  --ink-muted: #94a3b8;
  --pencil-lead: #cbd5e1;
  --red-pencil: #fb7185;
  --blue-ink: #38bdf8;
  --cyan-accent: #22d3ee;
  --emerald-accent: #34d399;
  --amber-accent: #fbbf24;
  --yellow-sticky: #221d12;
  --sticky-border: #92400e;
  --sticky-shadow: rgba(0, 0, 0, 0.4);
  --border-pencil: #2d3748;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-hand: 'Patrick Hand', 'Caveat', cursive, sans-serif;
  --font-title: 'Caveat', cursive, sans-serif;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: #080a0f;
  background-image: radial-gradient(#1e2738 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  background-repeat: repeat;
  background-attachment: fixed;
  color-scheme: dark;
  overscroll-behavior-y: contain !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: max(12px, var(--sat)) max(10px, var(--sar)) max(30px, var(--sab)) max(10px, var(--sal));
  background-color: transparent;
  background-image: radial-gradient(#1e2738 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  background-repeat: repeat;
  background-attachment: fixed;
  font-family: var(--font-ui);
  color: var(--ink-color);
  font-size: 16px;
  line-height: 1.45;
  overscroll-behavior-y: contain !important;
  display: block;
}

.alpha-tile, .paper-btn {
  touch-action: manipulation;
}

/* Application Container (Responsive Compact Notepad) */
.app-container {
  width: 100%;
  max-width: 470px;
  margin: 16px auto;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Titanium Spiral Rings */
.spiral-rings {
  display: flex;
  justify-content: space-around;
  padding: 0 16px;
  position: relative;
  top: 8px;
  z-index: 5;
  pointer-events: none;
}

.spiral-rings span {
  width: 12px;
  height: 22px;
  background: linear-gradient(135deg, #475569, #1e293b, #64748b, #0f172a);
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
  border: 1px solid #334155;
  display: inline-block;
}

/* Dark Paper Sheet (Clean solid surface, no overlapping lines) */
.paper-sheet {
  background-color: var(--paper-bg);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.07);
  border: 1.5px solid #283042;
  padding: 16px 16px 24px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Header (Sticky at top of notepad, voice buttons always accessible on iOS) */
.game-header {
  position: sticky;
  top: 0;
  background: rgba(20, 24, 36, 0.98);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  padding: 6px 0 10px 0;
  margin-bottom: 12px;
  border-bottom: 2px dashed #2d3748;
  z-index: 50;
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.logo-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  box-shadow: 0 2px 6px rgba(56, 189, 248, 0.25);
}

.paper-title {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: -0.3px;
  line-height: 1.1;
  white-space: nowrap;
  text-shadow: 0 0 16px rgba(56, 189, 248, 0.3);
}

.subtitle-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(30, 41, 59, 0.65);
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid #334155;
  flex-shrink: 0;
}

.voice-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.paper-subtitle {
  font-size: 10.5px;
  color: #cbd5e1;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
}

/* Session Scoreboard (Blue Player 1 vs Yellow Player 2: e.g. 1 / 1) */
.session-scoreboard {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #0d121c;
  border: 1.5px solid #222d40;
  border-radius: 20px;
  padding: 2px 14px;
  margin: 4px auto 6px auto;
  font-size: 15px;
  font-weight: 800;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.2);
}

.p1-score-val {
  color: #38bdf8 !important;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.p2-score-val {
  color: #facc15 !important;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(250, 204, 21, 0.4);
}

.score-divider {
  color: #64748b;
  font-weight: 800;
  font-size: 14px;
}

/* Player Color Theming */
.player1-theme {
  color: #38bdf8 !important;
}

/* Real-Time Disconnection & Reconnection Banner */
.connection-status-banner {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  margin: 6px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: banner-pulse 1.4s infinite ease-in-out;
  transition: all 0.25s ease;
}

.connection-status-banner.warning {
  background: rgba(245, 158, 11, 0.18);
  border: 1.5px solid #f59e0b;
  color: #fde68a;
}

.connection-status-banner.error {
  background: rgba(239, 68, 68, 0.22);
  border: 1.5px solid #ef4444;
  color: #fca5a5;
}

.connection-status-banner.success {
  background: rgba(16, 185, 129, 0.2);
  border: 1.5px solid #10b981;
  color: #6ee7b7;
  animation: none;
}

@keyframes banner-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.78; transform: scale(0.99); }
}

/* Voice Panel Strip: 2-Column Balanced Player Cards */
.voice-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 0;
  margin-top: 6px;
  width: 100%;
  box-sizing: border-box;
}

.voice-player-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: #141b26;
  border: 1px solid #2d3748;
  border-radius: 8px;
  padding: 5px 8px;
  min-width: 0;
  box-sizing: border-box;
  min-height: 34px;
}

.voice-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #cbd5e1;
  font-weight: 700;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
}

.v-name {
  max-width: 65px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Micro Voice Control Buttons (Guaranteed inside bounds) */
.voice-control-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  height: 24px !important;
  min-height: 24px !important;
  max-height: 24px !important;
  padding: 0 8px !important;
  margin: 0 !important;
  border-radius: 6px !important;
  font-family: var(--font-ui) !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
  border: 1px solid transparent;
  outline: none;
  white-space: nowrap;
  box-sizing: border-box !important;
  line-height: 1 !important;
  transition: transform 0.1s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.mic-btn {
  background: #e11d48;
  color: white;
  border-color: #be123c;
}

.mic-btn.unmuted {
  background: #059669;
  border-color: #047857;
}

.mic-btn:active {
  transform: scale(0.93);
}

.mute-peer-btn {
  background: #242f42;
  color: #cbd5e1;
  border-color: #3b485d;
}

.mute-peer-btn.muted {
  background: #3b2a2e;
  color: #f87171;
  border-color: #e11d48;
}

.mute-peer-btn:active {
  transform: scale(0.93);
}

.user-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64748b;
  flex-shrink: 0;
}

.voice-badge.speaking .user-dot {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.voice-badge.speaking .v-name {
  color: #34d399;
}

.audio-wave {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 10px;
  margin-left: 2px;
}

.audio-wave i {
  width: 2px;
  height: 100%;
  background: #10b981;
  border-radius: 1px;
  animation: wave 0.8s infinite ease-in-out;
}
.audio-wave i:nth-child(2) { animation-delay: 0.2s; }
.audio-wave i:nth-child(3) { animation-delay: 0.4s; }

@keyframes wave {
  0%, 100% { height: 2px; }
  50% { height: 10px; }
}

/* ==========================================================================
   ALPHABET SCRATCHPAD (A to Z) - RESPONSIVE DESKTOP & MOBILE
   ========================================================================== */

.alphabet-section {
  width: 100%;
}

.alphabet-header {
  margin-bottom: 6px;
}

.scratchpad-tag {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 600;
}

.tag-sub {
  font-size: 12px;
  color: #64748b;
  font-weight: normal;
}

.alphabet-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.alpha-row {
  display: flex;
  gap: 4px;
  justify-content: center;
  width: 100%;
}

.alpha-tile {
  flex: 1;
  max-width: 48px;
  height: 38px;
  background: #1e2433;
  border: 1.5px solid #334155;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 700;
  color: #f1f5f9;
  cursor: pointer;
  position: relative;
  user-select: none;
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.08s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.alpha-tile:hover {
  border-color: var(--blue-ink);
  background-color: #262e40;
}

.alpha-tile:active {
  transform: scale(0.92);
}

/* Crossed Letter State */
.alpha-tile.crossed {
  color: #475569;
  background-color: #121620;
  border-color: #232a3b;
}

.alpha-tile.crossed::after {
  content: "✕";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 26px;
  font-weight: 900;
  color: var(--red-pencil);
  text-shadow: 0 0 8px rgba(251, 113, 133, 0.5);
  pointer-events: none;
  line-height: 1;
}

/* Game Content */
.game-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 5;
}

.stage-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.hidden {
  display: none !important;
}

/* Fold Notes (Sticky Note) */
.paper-fold-note {
  background: #1c2333;
  padding: 16px 18px;
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--sticky-shadow);
  border: 1px solid #2d3748;
  border-left: 4px solid #38bdf8;
}

.paper-fold-note h2 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 6px;
  line-height: 1.2;
}

.paper-fold-note p {
  font-size: 14px;
  color: #cbd5e1;
  line-height: 1.5;
}

/* Forms & Action Cards */
.lobby-form-box, .room-share-box, .word-entry-box {
  background: #1a202c;
  border: 1.5px solid #2d3748;
  border-radius: 10px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input-group label {
  font-size: 15px;
  font-weight: 600;
  color: #e2e8f0;
}

.helper-text {
  font-size: 12px;
  color: #94a3b8;
}

.paper-input {
  font-family: var(--font-ui);
  font-size: 17px;
  padding: 10px 12px;
  border: 2px solid #3b4559;
  border-radius: 8px;
  background: #0f131a;
  color: #f8fafc;
  outline: none;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.paper-input:focus {
  border-color: var(--blue-ink);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.uppercase-input {
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}

/* Buttons */
.paper-btn {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 8px;
  border: 2px solid #384252;
  background: #222938;
  color: #f1f5f9;
  cursor: pointer;
  box-shadow: 2px 3px 0px #0f131a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  min-height: 46px;
  transition: all 0.12s ease;
}

.paper-btn:hover {
  filter: brightness(1.08);
}

.paper-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px #0f131a;
}

.paper-btn:disabled,
.paper-btn.disabled-btn {
  opacity: 0.38 !important;
  cursor: not-allowed !important;
  filter: grayscale(0.85);
  pointer-events: none !important;
  box-shadow: none !important;
  transform: none !important;
}

.full-width {
  width: 100%;
}

.flex-btn {
  flex: 1;
}

.primary-btn {
  background: #d97706;
  border-color: #b45309;
  color: #ffffff;
  box-shadow: 2px 3px 0px #78350f;
}

.secondary-btn {
  background: #0284c7;
  border-color: #0369a1;
  color: #ffffff;
  box-shadow: 2px 3px 0px #075985;
}

.divider-or {
  text-align: center;
  position: relative;
  margin: 6px 0;
}

.divider-or::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #2d3748;
}

.divider-or span {
  background: #1a202c;
  padding: 0 10px;
  position: relative;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.join-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Room Code Share */
.room-code-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #0f131a;
  border: 2px dashed #0284c7;
  border-radius: 8px;
  padding: 12px;
}

.code-label {
  font-size: 16px;
  color: #38bdf8;
  font-weight: 500;
}

.code-value {
  font-family: monospace;
  font-size: 24px;
  font-weight: bold;
  color: #e0f2fe;
  letter-spacing: 2px;
}

.share-buttons-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 8px;
  width: 100%;
}

.whatsapp-btn {
  background: #16a34a !important;
  color: white !important;
  border-color: #15803d !important;
}

.whatsapp-btn:hover {
  background: #15803d !important;
}

.toast-message {
  display: none;
  background: #059669;
  color: white;
  text-align: center;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}

.rules-doodle {
  font-size: 14px;
  color: #cbd5e1;
  background: #141923;
  border: 1px solid #283142;
  border-radius: 8px;
  padding: 12px 16px;
}

.rules-doodle h3 {
  color: #38bdf8;
  margin-bottom: 6px;
}

.rules-doodle ol {
  margin-left: 18px;
}

.rules-doodle li {
  margin-bottom: 4px;
  line-height: 1.4;
}

/* Word Submitted Sealed State */
.word-submitted-state {
  text-align: center;
  padding: 24px 16px;
  background: #1a1e2b;
  border: 2px dashed #d97706;
  border-radius: 10px;
}

.doodle-seal .seal-icon {
  font-size: 38px;
  display: block;
  margin-bottom: 8px;
}

.my-word-preview {
  font-size: 20px;
  margin: 10px 0;
  color: #38bdf8;
}

.waiting-partner-text {
  font-size: 15px;
  color: #94a3b8;
}

/* ==========================================================================
   ACTIVE GUESSING STAGE & NUMBERED BLANKS
   ========================================================================== */

.turn-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: #064e3b;
  border: 2px solid #10b981;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 700;
  color: #a7f3d0;
  text-align: center;
}

.turn-banner.their-turn {
  background: #451a03;
  border-color: #f59e0b;
  color: #fde68a;
}

/* Target Word Container & Numbered Slots */
.target-word-container {
  background: #1a202c;
  border: 2px solid #334155;
  border-radius: 10px;
  padding: 16px 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.target-word-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px dashed #334155;
  padding-bottom: 6px;
}

.target-label {
  font-weight: 700;
  font-size: 16px;
  color: #e2e8f0;
}

.word-length-pill {
  font-size: 13px;
  background: #0f131a;
  padding: 3px 9px;
  border-radius: 12px;
  color: #38bdf8;
  border: 1px solid #1e293b;
  font-weight: 600;
}

/* Numbered Slots Wrapper (Stacked Word Lines) */
.numbered-slots-wrapper {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  min-height: 64px;
  width: 100%;
  box-sizing: border-box;
}

/* Dedicated Row / Line for each individual word */
.word-slots-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: flex-end;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 2px 0;
}

/* Adaptive Sizing per Word Length */
.word-slots-line.size-lg {
  gap: 8px;
}
.word-slots-line.size-lg .letter-slot {
  min-width: 32px;
  max-width: 44px;
}
.word-slots-line.size-lg .slot-char {
  font-size: 32px;
  height: 36px;
}
.word-slots-line.size-lg .slot-num {
  font-size: 13px;
}

.word-slots-line.size-md {
  gap: 5px;
}
.word-slots-line.size-md .letter-slot {
  min-width: 22px;
  max-width: 32px;
}
.word-slots-line.size-md .slot-char {
  font-size: 25px;
  height: 29px;
}
.word-slots-line.size-md .slot-num {
  font-size: 11.5px;
}

.word-slots-line.size-sm {
  gap: 4px;
}
.word-slots-line.size-sm .letter-slot {
  min-width: 17px;
  max-width: 24px;
}
.word-slots-line.size-sm .slot-char {
  font-size: 20px;
  height: 24px;
  border-bottom-width: 2px;
}
.word-slots-line.size-sm .slot-num {
  font-size: 10.5px;
}

.word-slots-line.size-xs {
  gap: 2.5px;
}
.word-slots-line.size-xs .letter-slot {
  min-width: 13px;
  max-width: 19px;
}
.word-slots-line.size-xs .slot-char {
  font-size: 16px;
  height: 20px;
  border-bottom-width: 2px;
}
.word-slots-line.size-xs .slot-num {
  font-size: 9px;
}

/* Single Letter Slot with Number Underneath */
.letter-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 28px;
  max-width: 44px;
  flex: 0 1 auto;
  cursor: pointer;
  box-sizing: border-box;
}

.slot-char {
  font-family: var(--font-hand);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 3px solid #64748b;
  width: 100%;
  color: #f8fafc;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.letter-slot.revealed .slot-char {
  color: #34d399;
  border-bottom-color: #059669;
  text-shadow: 0 0 12px rgba(52, 211, 153, 0.45);
  animation: pop-reveal 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop-reveal {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.slot-num {
  font-size: 12px;
  color: #64748b;
  margin-top: 3px;
  font-family: monospace;
  font-weight: bold;
}

.my-word-separator {
  display: block;
  height: 4px;
  width: 100%;
}

/* 5-Second Spellcheck Countdown */
.spellcheck-countdown-box {
  margin: 14px 0 6px 0;
  padding: 12px;
  background: #0f172a;
  border: 1.5px solid #0284c7;
  border-radius: 8px;
  text-align: center;
}

.countdown-timer-text {
  font-size: 15px;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 8px;
}

.countdown-timer-text strong {
  color: #f59e0b;
  font-size: 18px;
}

.countdown-progress-track {
  width: 100%;
  height: 6px;
  background: #1e293b;
  border-radius: 4px;
  overflow: hidden;
}

.countdown-progress-bar {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #0284c7);
  transition: width 0.1s linear;
}

.edit-word-btn {
  background: #334155 !important;
  color: #f1f5f9 !important;
  border-color: #475569 !important;
  font-size: 14px !important;
  padding: 8px 16px !important;
}

.edit-word-btn:hover {
  background: #475569 !important;
}

/* Partner Lock Banner in Word Setup */
.partner-lock-banner {
  background: #1e293b;
  border: 1.5px solid #0284c7;
  border-left: 5px solid #38bdf8;
  color: #38bdf8;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
}

/* Turn Status prompt directly above input box */
.turn-prompt-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.turn-prompt-box.my-turn {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid #10b981;
  color: #34d399;
}

.turn-prompt-box.partner-turn {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid #d97706;
  color: #fbbf24;
}

/* In-Page Inline Error Message (Red color under turn indicator) */
.turn-error-msg {
  color: #fca5a5;
  background: rgba(220, 38, 38, 0.2);
  border: 1.5px solid #ef4444;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 700;
  text-align: center;
  margin: 6px 0 8px 0;
  animation: shake-anim 0.3s ease-in-out;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.inline-error-msg {
  color: #fca5a5;
  background: rgba(220, 38, 38, 0.2);
  border: 1.5px solid #ef4444;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 700;
  text-align: center;
  margin: 8px 0;
  animation: shake-anim 0.3s ease-in-out;
}

@keyframes shake-anim {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* Disclosed Letter in My Secret Word (Red Color) */
.disclosed-letter {
  color: #ef4444 !important;
  font-weight: 900 !important;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.7) !important;
  padding: 0 1px;
  display: inline-block;
  transform: scale(1.05);
}

.hidden-letter {
  color: #f1f5f9;
  font-weight: 700;
}

/* Turn Disabled state for Alphabet Board & inputs */
.alphabet-section.turn-disabled {
  opacity: 0.3 !important;
  filter: grayscale(1) !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
}

.alphabet-section.turn-disabled .alpha-tile,
.alpha-tile.tile-disabled,
.alpha-tile:disabled {
  opacity: 0.25 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.guess-input:disabled,
.guess-input[readonly] {
  opacity: 0.35 !important;
  background: #0b0f17 !important;
  cursor: not-allowed !important;
  border-color: #1e293b !important;
  color: #64748b !important;
  pointer-events: none !important;
}

.guess-btn:disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  background: #1e293b !important;
  border-color: #334155 !important;
  pointer-events: none !important;
}

/* Guess Input Form */
.guess-input-container {
  margin-top: 4px;
}

.guess-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.guess-input-row {
  display: flex;
  gap: 8px;
}

.guess-input {
  flex: 1;
  font-size: 19px;
  padding: 10px 14px;
}

.guess-btn {
  background: #059669;
  color: white;
  border-color: #047857;
  box-shadow: 2px 3px 0px #064e3b;
  white-space: nowrap;
  padding: 10px 18px;
}

/* Guess Feed Box */
.guess-feed-box {
  background: #141923;
  border: 1.5px solid #283142;
  border-radius: 8px;
  padding: 8px 12px;
  max-height: 110px;
  overflow-y: auto;
  font-size: 14px;
}

.feed-header {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.feed-items {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.feed-item {
  color: #94a3b8;
}

.feed-item.match {
  color: #34d399;
  font-weight: 600;
}

.feed-item.miss {
  color: #fb7185;
}

/* Sticky Note for Own Secret Word */
.my-word-sticky-note {
  background: var(--yellow-sticky);
  border: 1px solid var(--sticky-border);
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: 0 3px 8px var(--sticky-shadow);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  line-height: 1.5;
  box-sizing: border-box;
}

.sticky-pin {
  font-size: 16px;
  flex-shrink: 0;
}

.sticky-title {
  color: #fbbf24;
  font-weight: 600;
  white-space: nowrap;
}

.sticky-word {
  font-family: var(--font-hand);
  font-size: 20px;
  color: #38bdf8;
  letter-spacing: 0.5px;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  word-break: normal;
}

.sticky-word-chunk {
  display: inline-block;
  white-space: nowrap;
  letter-spacing: 1px;
}

/* Victory / Game Over */
.victory-note {
  text-align: center;
  background: #064e3b;
  border-left-color: #10b981;
}

.victory-note h2 {
  color: #34d399;
  font-size: 32px;
}

.victory-note p {
  color: #a7f3d0;
}

.game-over-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-card {
  background: #1a202c;
  border: 1.5px solid #334155;
  border-radius: 8px;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sum-label {
  font-size: 15px;
  color: #94a3b8;
}

.sum-word {
  font-family: var(--font-hand);
  font-size: 24px;
  color: var(--blue-ink);
  letter-spacing: 1.5px;
}

/* Notepad Footer Credit */
.notepad-footer {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  text-align: center;
  font-family: var(--font-ui);
  font-size: 13.5px;
  color: #fbbf24;
  letter-spacing: 0.3px;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.footer-dot {
  color: #64748b;
  font-size: 12px;
}

.app-version-badge {
  font-size: 11.5px;
  font-family: monospace;
  font-weight: 700;
  color: #38bdf8;
  background: #0f172a;
  border: 1px solid #1e293b;
  padding: 1px 7px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

.notepad-footer strong {
  color: #f59e0b;
  font-weight: 700;
}

.notepad-footer .heart-icon {
  color: #fbbf24;
  margin: 0 2px;
  display: inline-block;
  animation: pulse-heart 2s infinite ease-in-out;
}

/* Fullscreen Confetti & Flying Graffiti Canvas */
.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99999;
}

/* ==========================================================================
   MOBILE SPECIFIC ADJUSTMENTS (< 600px)
   ========================================================================== */
@media (max-width: 600px) {
  body {
    padding: max(6px, var(--sat)) max(6px, var(--sar)) max(90px, calc(var(--sab) + 70px)) max(6px, var(--sal));
    min-height: 100%;
    display: block;
  }

  .app-container {
    max-width: 100%;
    margin: 0 auto;
    min-height: auto;
  }

  .spiral-rings {
    padding: 0 14px;
    top: 7px;
  }

  .spiral-rings span {
    width: 12px;
    height: 20px;
  }

  .paper-sheet {
    border-radius: 12px;
    padding: 10px 10px 24px 12px;
    min-height: auto;
  }

  .game-header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 6px 0 8px 0;
    margin-bottom: 8px;
    background: rgba(20, 24, 36, 0.98);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }

  .alpha-tile {
    height: 34px;
    font-size: 16px;
  }

  .slot-char {
    font-size: 26px;
    height: 30px;
  }

  .guess-input {
    font-size: 16px !important;
    letter-spacing: 0.5px !important;
    padding: 8px 10px !important;
  }

  .guess-btn {
    padding: 8px 14px !important;
    font-size: 16px !important;
    white-space: nowrap !important;
  }

  .paper-input {
    font-size: 16px !important;
  }

  .notepad-footer {
    margin-top: 24px;
    padding-bottom: max(30px, env(safe-area-inset-bottom, 20px));
  }
}

/* ==========================================================================
   DESKTOP COMPACT SINGLE-SCREEN LAYOUT (> 600px)
   ========================================================================== */
@media (min-width: 601px) {
  body {
    padding: 6px 12px;
  }
  .app-container {
    max-width: 500px;
    margin: 4px auto;
  }
  .paper-sheet {
    padding: 12px 16px 14px 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  }
  .game-header {
    margin-bottom: 6px;
    padding-bottom: 4px;
  }
  .session-scoreboard {
    margin-bottom: 6px;
    padding: 3px 12px;
    font-size: 13px;
  }
  .voice-status-panel {
    margin-bottom: 8px;
    padding: 4px 8px;
  }
  .guessing-target-card {
    padding: 10px 14px;
    margin-bottom: 8px;
  }
  .target-card-header {
    margin-bottom: 6px;
    font-size: 13px;
  }
  .word-slots-wrapper {
    margin: 4px 0;
    gap: 4px;
  }
  .word-slots-line {
    gap: 3px;
  }
  .letter-slot {
    min-width: 22px;
    height: 36px;
    padding: 0 2px;
  }
  .letter-slot .slot-char {
    font-size: 22px;
    line-height: 22px;
    height: 24px;
  }
  .letter-slot .slot-num {
    font-size: 10px;
  }
  .secret-reminder-card {
    padding: 6px 12px;
    margin-bottom: 8px;
    font-size: 13px;
  }
  .turn-prompt-box {
    padding: 6px 12px;
    margin-bottom: 8px;
    font-size: 13px;
  }
  .guess-input-group {
    margin-bottom: 8px;
    gap: 8px;
  }
  .guess-text-input {
    height: 36px;
    font-size: 13.5px;
    padding: 6px 12px;
  }
  .btn-guess-submit {
    height: 36px;
    padding: 0 16px;
    font-size: 13.5px;
  }
  .alphabet-scratchpad {
    margin-top: 4px;
    padding: 6px 8px;
  }
  .scratchpad-title {
    font-size: 11.5px;
    margin-bottom: 4px;
  }
  .alpha-grid {
    gap: 4px;
  }
  .alpha-tile {
    height: 30px;
    font-size: 14px;
  }
  .guess-feed-box {
    max-height: 60px;
  }
  .notepad-footer {
    margin-top: 8px;
    padding-bottom: 4px;
    font-size: 11.5px;
  }
}

/* Enhanced Desktop Mouse & Trackpad Hover Effects (Chrome & Edge) */
@media (hover: hover) and (pointer: fine) {
  .alpha-tile:hover:not(.crossed):not(.tile-disabled) {
    border-color: #38bdf8 !important;
    background-color: #252f44 !important;
    transform: translateY(-1.5px);
    box-shadow: 0 4px 10px rgba(56, 189, 248, 0.25);
  }
  .paper-btn:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: translateY(-1px);
  }
  .voice-control-btn:hover {
    filter: brightness(1.15);
    transform: scale(1.03);
  }
}
