/* ==========================================================================
   WORD ODYSSEY - THEMATIC WORDLE ADVENTURE STYLESHEET
   Touch-Friendly, 3D Tile Flip Animation, Neon Green/Yellow, Educational Fact Cards
   ========================================================================== */

.wo-arena-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 16px 40px;
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

/* Top HUD Bar */
.wo-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.wo-stat-pill {
  background: #111a2e;
  border: 1px solid #10b981;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 13.5px;
  font-weight: 700;
  color: #6ee7b7;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Header Box */
.wo-header-box {
  text-align: center;
  margin-bottom: 14px;
}

.wo-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #10b981, #facc15, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 2px;
}

.wo-subtitle {
  font-size: 13.5px;
  color: #94a3b8;
}

/* Category Selector Pills Bar */
.wo-cat-bar {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
  width: 100%;
}

.wo-cat-pill {
  background: #111a2e;
  border: 1px solid #334155;
  color: #94a3b8;
  padding: 7px 14px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  touch-action: manipulation;
}

.wo-cat-pill:hover {
  border-color: #10b981;
  color: #ffffff;
}

.wo-cat-pill.active {
  background: #10b981;
  border-color: #34d399;
  color: #0f172a;
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
}

/* Word Matrix Board */
.wo-board-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
  width: 100%;
  max-width: 380px;
}

.wo-row {
  display: grid;
  gap: 8px;
  width: 100%;
}

.wo-tile {
  aspect-ratio: 1 / 1;
  min-height: 52px;
  background: #0f172a;
  border: 2px solid #334155;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  transition: transform 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.wo-tile.filled {
  border-color: #64748b;
}

.wo-tile.pop {
  animation: tilePop 0.1s ease-in-out;
}

@keyframes tilePop {
  0% { transform: scale(0.9); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* 3D Flip Card Reveal */
.wo-tile.revealed {
  animation: tileFlip 0.5s ease forwards;
}

@keyframes tileFlip {
  0% { transform: rotateX(0deg); }
  50% { transform: rotateX(90deg); }
  100% { transform: rotateX(0deg); }
}

/* Tile State Colors */
.wo-tile.green {
  background: #059669 !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
  color: #ffffff;
}

.wo-tile.yellow {
  background: #d97706 !important;
  border-color: #f59e0b !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
  color: #ffffff;
}

.wo-tile.gray {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #64748b;
}

/* Clue Box & Clue Button */
.wo-clue-card {
  width: 100%;
  max-width: 420px;
  background: #111a2e;
  border: 1px solid #f59e0b;
  border-radius: 14px;
  padding: 12px 16px;
  color: #fde047;
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 14px;
  animation: fadeIn 0.2s ease;
}

.wo-actions-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.wo-action-btn {
  padding: 10px 18px;
  border-radius: 9999px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  border: none;
  min-height: 46px;
  touch-action: manipulation;
}

.wo-action-btn.clue {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid #f59e0b;
  color: #fcd34d;
}

.wo-action-btn.clue.unlocked {
  background: #f59e0b;
  color: #0f172a;
  font-weight: 800;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
}

.wo-action-btn.clue:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wo-action-btn.kb-toggle {
  background: #1e293b;
  border: 1px solid #6366f1;
  color: #c7d2fe;
}

.wo-action-btn.kb-toggle:hover {
  background: #312e81;
  border-color: #818cf8;
}

.wo-action-btn.new {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
}

/* Hidden Native Input Proxy for iPad / Mac */
.wo-native-input-proxy {
  position: absolute;
  top: -200px;
  left: -200px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  font-size: 16px; /* Prevents auto-zoom in iOS Safari */
}

/* Tactile On-Screen QWERTY Keyboard */
.wo-keyboard-container {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.wo-key-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  width: 100%;
}

.wo-key {
  height: 52px;
  flex: 1;
  min-width: 32px;
  max-width: 46px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  touch-action: manipulation;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

.wo-key:hover {
  background: #334155;
  transform: translateY(-1px);
}

.wo-key.special {
  flex: 1.5;
  max-width: 68px;
  font-size: 13px;
  font-weight: 800;
  background: #334155;
}

.wo-key.green {
  background: #059669 !important;
  border-color: #10b981 !important;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.wo-key.yellow {
  background: #d97706 !important;
  border-color: #f59e0b !important;
  color: #ffffff;
}

.wo-key.gray {
  background: #0f172a !important;
  border-color: #1e293b !important;
  color: #475569;
}

/* Fact Card Modal Overlay */
.wo-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.wo-modal-card {
  background: linear-gradient(145deg, #0f172a, #064e3b);
  border: 2px solid #34d399;
  border-radius: 28px;
  padding: 30px 24px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(52, 211, 153, 0.3);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wo-modal-icon {
  font-size: 50px;
  margin-bottom: 8px;
}

.wo-modal-title {
  font-size: 24px;
  font-weight: 800;
  color: #34d399;
  margin-bottom: 6px;
}

.wo-modal-word {
  font-size: 32px;
  font-weight: 900;
  color: #fde047;
  letter-spacing: 4px;
  margin: 10px 0;
}

.wo-modal-fact {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid #10b981;
  border-radius: 16px;
  padding: 14px;
  color: #e2e8f0;
  font-size: 14.5px;
  line-height: 1.5;
  margin: 14px 0;
  text-align: left;
}

.wo-modal-stats {
  font-size: 13.5px;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.wo-modal-aura {
  font-size: 16px;
  font-weight: 800;
  color: #4ade80;
  margin-bottom: 20px;
}

.wo-modal-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: 9999px;
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  transition: all 0.15s ease;
  min-height: 52px;
}
