/* Teacher console — mobile-first private view, in the paste-up system
   (docs/paper-layout-test/): cut paper on a grained gesso ground, ink
   chrome, one vermillion for the go actions. Quieter than the projector:
   this is a tool. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root { --focus-ring: 3px solid #221E1C; }

body {
  font-family: 'Nunito', Arial, sans-serif;
  font-weight: 600;
  background: #EFE9DC;
  color: #221E1C;
  min-height: 100vh;
}

/* Grain over the gesso, under the paper pieces */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    radial-gradient(rgba(120,105,80,0.35) 0.5px, transparent 0.6px),
    radial-gradient(rgba(80,70,55,0.22) 0.5px, transparent 0.6px);
  background-size: 4px 4px, 7px 7px;
  background-position: 0 0, 2px 3px;
}

/* Ink band header: the private-tool mark */
header {
  background: #221E1C;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 3px 0 rgba(34,30,28,0.10);
}

.logo {
  color: #FBF7EC;
  font-family: 'Archivo Black', 'Arial Black', Arial, sans-serif;
  font-size: 1rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.header-room {
  color: #CFC5B4;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: right;
  min-width: 0;
}

section { padding: 18px 16px; max-width: 560px; margin: 0 auto; }

h1, h2 {
  font-family: 'Archivo Black', 'Arial Black', Arial, sans-serif;
  font-weight: 400;
}

/* --- Join --- */
#join-section h1 { font-size: 1.4rem; margin-bottom: 8px; }

.join-hint {
  font-size: 0.9rem;
  color: #55503F;
  line-height: 1.5;
  margin-bottom: 18px;
}

#join-section label {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6E6353;
  margin: 12px 0 4px;
}

/* Inputs sit square with an inset shadow */
#join-section input {
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 2px;
  background: #FFFDF6;
  box-shadow: inset 2px 2px 0 rgba(34,30,28,0.10), 0 0 0 1px rgba(34,30,28,0.16);
  font-family: 'Archivo Black', 'Arial Black', Arial, sans-serif;
  font-size: 1.3rem;
  text-align: center;
  letter-spacing: 4px;
  color: #221E1C;
}

#join-section input::placeholder {
  color: #9A8F7C;
  font-family: 'Nunito', Arial, sans-serif;
  font-weight: 600;
  letter-spacing: 2px;
}

#join-section input:focus {
  outline: none;
  box-shadow: inset 2px 2px 0 rgba(34,30,28,0.10), 0 0 0 2px #221E1C;
}

/* Connect is the go action: the vermillion cut */
#join-btn {
  width: 100%;
  margin-top: 18px;
  padding: 14px;
  font-family: 'Archivo Black', 'Arial Black', Arial, sans-serif;
  font-size: 1.1rem;
  text-transform: uppercase;
  background: #D9481C;
  color: #FFF6EA;
  border: none;
  border-radius: 2px;
  transform: rotate(-0.5deg);
  box-shadow: 3px 3px 0 rgba(34,30,28,0.18);
  cursor: pointer;
  transition: transform 90ms steps(2, end), box-shadow 90ms steps(2, end);
}

#join-btn:hover {
  transform: rotate(-0.5deg) translate(2px, 2px);
  box-shadow: 0 0 0 rgba(34,30,28,0.18);
}

#join-btn:disabled {
  background: #D8D2C4;
  color: #857A66;
  box-shadow: none;
  transform: none;
}

.join-error {
  margin-top: 12px;
  color: #AE3A16;
  font-weight: 800;
  font-size: 0.9rem;
}

/* --- Console --- */
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.phase-label {
  font-size: 0.95rem;
  font-weight: 800;
  background: #FFFDF6;
  border: none;
  border-radius: 2px;
  box-shadow: 2px 2px 0 rgba(34,30,28,0.14);
  transform: rotate(-0.5deg);
  padding: 8px 16px;
}

/* Needs-you state flips to ink and breathes */
.phase-label-attention {
  background: #221E1C;
  color: #FBF7EC;
  animation: pulse 1.2s infinite;
}
@keyframes pulse { 50% { transform: rotate(-0.5deg) scale(1.04); } }

.count-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: #55503F;
  white-space: nowrap;
}

#console-section h2 { font-size: 1rem; margin: 14px 0 4px; }
#console-section h3 {
  font-family: 'Nunito', Arial, sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 12px 0 6px;
  color: #6E6353;
}

.block-hint {
  font-size: 0.8rem;
  color: #6E6353;
  line-height: 1.4;
  margin-bottom: 10px;
}

.entries-list { list-style: none; }

.entry {
  background: #FFFDF6;
  border: none;
  border-radius: 2px;
  box-shadow: 2px 2px 0 rgba(34,30,28,0.12), 0 0 0 1px rgba(34,30,28,0.08);
  padding: 10px 12px;
  margin-bottom: 8px;
}

.entry-hidden { opacity: 0.45; background: #E4DECE; }
.entry-empty { color: #857A66; padding: 8px 0; }

.entry-name { font-weight: 800; font-size: 0.85rem; }
.entry-text { font-size: 0.95rem; margin: 4px 0 8px; line-height: 1.35; word-wrap: break-word; }
.entry-drawing {
  display: block;
  width: 100%;
  max-width: 220px;
  margin: 4px 0 8px;
  background: #fff;
  border: none;
  border-radius: 2px;
  box-shadow: 2px 2px 0 rgba(34,30,28,0.12), 0 0 0 1px rgba(34,30,28,0.10);
}

.entry-actions { display: flex; gap: 8px; }

.entry-btn {
  font-family: 'Nunito', Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 6px 14px;
  border: none;
  border-radius: 2px;
  background: #FFFDF6;
  box-shadow: 2px 2px 0 rgba(34,30,28,0.14);
  cursor: pointer;
  transition: transform 90ms steps(2, end), box-shadow 90ms steps(2, end);
}

.entry-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 rgba(34,30,28,0.14);
}

.entry-btn-danger {
  color: #AE3A16;
  box-shadow: 2px 2px 0 rgba(34,30,28,0.14), 0 0 0 1px #AE3A16;
}

/* --- Checklist detail --- */
.checklist-console-group {
  background: #FFFDF6;
  border: none;
  border-radius: 2px;
  box-shadow: 2px 2px 0 rgba(34,30,28,0.12), 0 0 0 1px rgba(34,30,28,0.08);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.checklist-console-group h3 {
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.checklist-console-item {
  display: block;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 7px 10px;
  margin-bottom: 5px;
  border: none;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(34,30,28,0.14);
  cursor: pointer;
}

.checklist-console-item.checklist-console-done {
  background: #EFE9DC;
  text-decoration: line-through;
  box-shadow: 0 0 0 1px rgba(34,30,28,0.14), inset 3px 0 0 #D9481C;
}

/* --- Preview --- */
.preview-text {
  background: #FBF7EC;
  border: none;
  border-radius: 2px;
  box-shadow: 3px 3px 0 rgba(34,30,28,0.10);
  transform: rotate(-0.2deg);
  padding: 14px;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
  margin-bottom: 10px;
}

.btn-row { display: flex; gap: 10px; margin-top: 10px; }

.btn-go, .btn-danger {
  flex: 1;
  padding: 12px;
  font-family: 'Archivo Black', 'Arial Black', Arial, sans-serif;
  font-size: 0.95rem;
  border: none;
  border-radius: 2px;
  box-shadow: 3px 3px 0 rgba(34,30,28,0.18);
  cursor: pointer;
  transition: transform 90ms steps(2, end), box-shadow 90ms steps(2, end);
}

.btn-go:hover:not(:disabled), .btn-danger:hover:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 rgba(34,30,28,0.18);
}

.btn-go { background: #D9481C; color: #FFF6EA; transform: rotate(-0.5deg); }
.btn-go:hover:not(:disabled) { transform: rotate(-0.5deg) translate(2px, 2px); }
.btn-danger {
  background: #FFFDF6;
  color: #AE3A16;
  box-shadow: 3px 3px 0 rgba(34,30,28,0.18), 0 0 0 1px #AE3A16;
}
.btn-go:disabled, .btn-danger:disabled {
  background: #D8D2C4;
  color: #857A66;
  box-shadow: none;
  transform: none;
}

/* --- Controls --- */
.controls-block[hidden] { display: none; } /* flex would override [hidden] */

.controls-block {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(34,30,28,0.18);
}

.controls-block button {
  flex: 1;
  padding: 12px;
  font-family: 'Archivo Black', 'Arial Black', Arial, sans-serif;
  font-size: 0.9rem;
  border: none;
  border-radius: 2px;
  box-shadow: 3px 3px 0 rgba(34,30,28,0.18);
  cursor: pointer;
  background: #FFFDF6;
  color: #221E1C;
  transition: transform 90ms steps(2, end), box-shadow 90ms steps(2, end);
}

.controls-block button:hover:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 rgba(34,30,28,0.18);
}

#close-step-btn { background: #221E1C; color: #FBF7EC; }
#next-step-btn { background: #FFFDF6; }
.controls-block button:disabled {
  background: #D8D2C4;
  color: #857A66;
  box-shadow: none;
  transform: none;
}

.console-note {
  margin-top: 14px;
  font-size: 0.85rem;
  color: #6E6353;
  text-align: center;
}
