/* ==========================================================================
   Guessquatch — Forage (4x4 Word Hunt) Styles
   Weathered Woodgrain Trail-Sign Theme with Yellow Trail-Blaze Accent.
   ========================================================================== */

.fg-screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Weathered Woodgrain Game Header Slat with Yellow Trail-Blaze Accent */
.fg-header {
  --wood-pos-x: 34%;
  --wood-pos-y: 62%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-left: 10px solid var(--blaze-forage);
}

.fg-header-left,
.fg-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fg-title {
  margin: 0;
  font-size: 1.24rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wood-text);
  text-shadow: 0 1px 2px rgba(20, 11, 4, 0.65);
}

.fg-play-area {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Compact Unified HUD & Timer Bar (Woodgrain Slat + Yellow Blaze) */
.fg-hud {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 13px 16px 15px;
  border-left: 10px solid var(--blaze-forage);
}

.fg-hud-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.fg-hud-timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 11px;
  border-radius: 5px;
  background-color: var(--wood-trough-bg);
  border: 1px solid var(--wood-trough-border);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.55);
  color: var(--blaze-forage);
}

.fg-clock-text {
  font-family: var(--font-mono);
  font-size: 1.32rem;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--wood-text);
}

.fg-hud-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.fg-stat-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 4px;
  background-color: var(--wood-streak-bg);
  border: 1px solid var(--wood-streak-border);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.fg-stat-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wood-text-muted);
}

.fg-stat-val {
  font-family: var(--font-mono);
  font-size: 0.98rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--wood-text);
}

.fg-goal-pill {
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(240, 196, 36, 0.45);
  background-color: var(--wood-streak-bg);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.55);
  color: #F5D45C;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.fg-goal-pill--cleared {
  background-color: var(--tile-correct-bg);
  border-color: var(--tile-correct-lip);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  color: var(--tile-correct-text);
}

.fg-timer-track {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background-color: var(--wood-trough-bg);
  border: 1px solid var(--wood-trough-border);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.fg-timer-fill {
  height: 100%;
  background-color: var(--blaze-forage);
  transition: width 180ms linear, background-color 180ms ease;
}

.fg-timer-fill--warn {
  background-color: var(--blaze-tracks);
}

.fg-timer-fill--urgent {
  background-color: var(--blaze-campfire);
}

/* Main Workspace */
.fg-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.fg-board-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

/* Word Preview Bar (Dark Recessed Wood Trough) */
.fg-preview-bar {
  width: 100%;
  max-width: 390px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  min-height: 54px;
}

.fg-preview-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.fg-preview-word {
  font-family: var(--font-mono);
  font-size: 1.24rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--wood-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fg-preview-placeholder {
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--wood-text-muted);
}

.fg-preview-pts {
  flex-shrink: 0;
}

.fg-preview-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.fg-shake {
  animation: gq-shake 340ms ease-in-out;
}

/* Feedback Line (Directly on Canvas) */
.fg-feedback {
  min-height: 20px;
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-secondary);
  text-align: center;
}

.fg-feedback--success {
  color: var(--status-success);
}

.fg-feedback--warning {
  color: var(--blaze-tracks);
}

.fg-feedback--error {
  color: var(--status-error);
}

/* 4x4 Recessed Dark-Wood Board & Chunky Tactile Wooden Letter Tiles */
.fg-grid-plate {
  width: 100%;
  max-width: 390px;
  padding: 15px;
  background-image: none;
  background-color: var(--wood-trough-solid);
  border: 2px solid var(--wood-border);
  border-radius: 10px;
  box-shadow:
    inset 0 4px 12px rgba(0, 0, 0, 0.72),
    inset 0 -1px 0 rgba(255, 228, 192, 0.12),
    0 5px 0 var(--wood-lip),
    0 10px 18px var(--wood-shadow);
}

.fg-grid-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
}

.fg-path-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.fg-path-outline {
  fill: none;
  stroke: #170F08;
  stroke-width: 12;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fg-path-line {
  fill: none;
  stroke: var(--blaze-forage);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fg-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.fg-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 7px;
  border: 1.5px solid var(--wood-tile-border);
  background-color: var(--wood-tile-bg);
  background-image:
    linear-gradient(var(--wood-tile-overlay), var(--wood-tile-overlay)),
    url('../assets/wood-slat.jpg');
  background-size: 100% 100%, 340px auto;
  background-repeat: no-repeat, repeat;
  color: var(--wood-text);
  text-shadow: 0 1px 2px rgba(18, 10, 4, 0.72);
  box-shadow:
    inset 0 1px 0 var(--wood-bevel-top),
    0 4px 0 var(--wood-tile-lip),
    0 6px 8px rgba(0, 0, 0, 0.35);
  font-family: var(--font-sans);
  font-size: 1.7rem;
  font-weight: 900;
  text-transform: uppercase;
  touch-action: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 60ms ease, box-shadow 60ms ease, background-color 90ms ease, border-color 90ms ease, filter 90ms ease;
}

.fg-tile:hover:not(.fg-tile--selected) {
  border-color: var(--blaze-forage-border);
  filter: brightness(1.07);
}

.fg-tile:active:not(.fg-tile--selected) {
  transform: translateY(3px);
  box-shadow:
    inset 0 1px 0 var(--wood-bevel-top),
    0 1px 0 var(--wood-tile-lip);
}

.fg-tile--selected {
  background-image: none;
  background-color: var(--blaze-forage);
  border-color: var(--blaze-forage-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 1px 0 var(--blaze-forage-lip);
  color: #1A1610;
  text-shadow: none;
  transform: translateY(3px);
}

.fg-tile--head {
  border-color: #FFF6D6;
}

.fg-tile-letter {
  line-height: 1;
  pointer-events: none;
}

.fg-tile-step {
  position: absolute;
  top: 4px;
  right: 6px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  line-height: 1;
  font-weight: 900;
  color: #1A1610;
  opacity: 0.78;
  pointer-events: none;
}

/* Side Column: Found Words & Room Opponents (Woodgrain Slats) */
.fg-side-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.fg-panel {
  padding: 16px;
}

.fg-found-list {
  max-height: 310px;
  overflow-y: auto;
  padding: 10px;
  border-radius: var(--radius-sm);
  background-color: var(--wood-trough-bg);
  border: 1.5px solid var(--wood-trough-border);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.52);
}

.fg-found-empty {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--wood-text-muted);
}

.fg-word-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fg-word-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 4px;
  background-color: var(--wood-streak-bg);
  border: 1px solid var(--wood-streak-border);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--wood-text);
}

.fg-word-chip-pts {
  color: #F5D45C;
  font-weight: 900;
}

.fg-word-chip--unique {
  background-color: var(--blaze-forage);
  border-color: var(--blaze-forage-lip);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: #1A1610;
}

.fg-word-chip--unique .fg-word-chip-pts {
  color: #1A1610;
}

.fg-word-chip--shared {
  opacity: 0.72;
}

.fg-word-chip--shared .fg-word-chip-text {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.fg-word-chip--missed {
  border-style: dashed;
  color: var(--wood-text-sub);
}

/* Room Opponents List */
.fg-opponents-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fg-opp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background-color: var(--wood-trough-bg);
  border: 1.5px solid var(--wood-trough-border);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
  color: var(--wood-text);
}

.fg-opp-row--local {
  border-color: var(--blaze-forage-border);
  border-left: 5px solid var(--blaze-forage);
}

.fg-opp-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.fg-opp-name {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--wood-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fg-reaction-bar-wrap {
  width: 100%;
}

/* Summaries & End-of-Round Reveal */
.fg-summary-slot {
  display: flex;
  justify-content: center;
  width: 100%;
}

.fg-summary-card {
  width: 100%;
  max-width: 560px;
  text-align: center;
  border-left: 10px solid var(--blaze-forage);
}

.fg-summary-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.fg-kpi {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 11px 8px;
}

.fg-kpi .stat-value {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--wood-text);
}

.fg-kpi .stat-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wood-text-muted);
}

.fg-summary-section {
  margin-top: 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fg-missed-details {
  margin-top: 14px;
  text-align: left;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background-color: var(--wood-trough-bg);
  border: 1.5px solid var(--wood-trough-border);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.55);
}

.fg-missed-summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--wood-text-sub);
}

/* Room Side-by-Side Word Reveal */
.fg-room-summary {
  width: 100%;
  max-width: 960px;
  border-left: 10px solid var(--blaze-forage);
}

.fg-room-summary-head {
  text-align: center;
  margin-bottom: 12px;
}

.fg-reveal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 16px;
}

.fg-reveal-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fg-reveal-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.fg-reveal-submeta {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--wood-text-muted);
}

/* Responsive Breakpoints */
@media (min-width: 640px) {
  .fg-tile {
    font-size: 1.9rem;
  }

  .fg-grid {
    gap: 11px;
  }

  .fg-summary-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .fg-reveal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .fg-workspace {
    grid-template-columns: minmax(0, 404px) minmax(0, 1fr);
    gap: 22px;
  }

  .fg-found-list {
    max-height: 370px;
  }

  .fg-reveal-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}
