/* Commit Monster program — a furry blue monster eats a code editor. */

.window--cookie {
  --bg-cookie: #101319;
  --panel: #181c26;
  --cookie-blue: #2b7de9;
  --cookie-brown: #c98a3e;
  --text-dim: #8a8f9c;
  --font-heading: 'Press Start 2P', monospace;
  --font-body: 'VT323', monospace;
  max-width: 720px;
}

.window--cookie .window-body {
  padding: 20px;
  background: var(--bg-cookie);
  color: #e6e8ee;
  font-family: var(--font-body);
}

.cm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-bottom: 14px;
}

.cm-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cm-field--grow {
  flex: 1 1 160px;
}

.cm-label {
  font-family: var(--font-heading);
  font-size: 0.55rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.cm-select {
  background: var(--panel);
  color: #fff;
  border: 2px solid #2a3040;
  border-radius: 4px;
  padding: 4px 8px;
  font-family: var(--font-body);
  font-size: 1.1rem;
}

.cm-range {
  flex: 1 1 auto;
  accent-color: var(--cookie-blue);
  min-width: 100px;
}

.cm-stage {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
}

#cm-screen {
  display: block;
  width: 100%;
  border: 2px solid rgba(43, 125, 233, 0.4);
  border-radius: 6px;
  background: #1a1d27;
  cursor: pointer;
  touch-action: manipulation;
}

.cm-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(16, 19, 25, 0.9);
  border-radius: 6px;
  text-align: center;
  padding: 16px;
}

.cm-overlay.is-hidden {
  display: none;
}

.cm-overlay-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--cookie-blue);
  text-shadow: 0 0 12px #2b7de9, 0 0 28px #2b7de955;
  line-height: 1.6;
}

.cm-overlay-msg {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.35;
  color: var(--text-dim);
}

.cm-btn {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  padding: 12px 18px;
  background: var(--cookie-blue);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 4px 0 #17498d;
  transition: transform 80ms ease, box-shadow 80ms ease;
}

.cm-btn:hover {
  filter: brightness(1.1);
}

.cm-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #17498d;
}

.cm-btn--small {
  font-size: 0.5rem;
  padding: 8px 12px;
  background: var(--panel);
  box-shadow: 0 3px 0 #0a0c10;
  border: 2px solid #2a3040;
}

.cm-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 640px;
  margin: 14px auto 0;
}

.cm-stat {
  background: var(--panel);
  border: 2px solid #2a3040;
  border-radius: 4px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.cm-stat-label {
  font-family: var(--font-heading);
  font-size: 0.5rem;
  color: var(--text-dim);
}

.cm-stat-value {
  font-size: 1.6rem;
  line-height: 1;
  color: var(--cookie-brown);
}

.cm-feed {
  max-width: 640px;
  margin: 14px auto 0;
}

.cm-feed-summary {
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 0.55rem;
  color: var(--text-dim);
  padding: 6px 0;
}

.cm-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 8px;
  background: #0b0d12;
  color: #cfd3dc;
  border: 2px solid #2a3040;
  border-radius: 4px;
  padding: 10px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.4;
  resize: vertical;
}

@media (max-width: 520px) {
  .window--cookie .window-body {
    padding: 12px;
  }

  .cm-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
