/* Negotiation Lab
   Two sides of a table: madder red and steel blue role colors against
   a cool paper ground. Fraunces for display, Public Sans for work,
   IBM Plex Mono for join codes. */

:root {
  --ink: #1C2733;
  --paper: #F2F3EF;
  --card: #FFFFFF;
  --line: #DBDED6;
  --muted: #66707C;
  --deal: #2F6B4F;
  --warn: #9E3B2E;
  --focus: #2E5E8A;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Public Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

.wrap { max-width: 620px; margin: 0 auto; padding: 20px 16px 64px; }
.wrap-wide { max-width: 1080px; }

h1, h2, h3, .display { font-family: "Fraunces", Georgia, serif; font-weight: 650; line-height: 1.15; }
h1 { font-size: 1.75rem; margin: 0.4em 0; }
h2 { font-size: 1.2rem; margin: 1.2em 0 0.5em; }
h3 { font-size: 1.02rem; margin: 1.2em 0 0.4em; }
.display { font-size: 2.1rem; }
a { color: var(--focus); }
.mono { font-family: "IBM Plex Mono", monospace; letter-spacing: 0.08em; }

.eyebrow {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--muted); font-weight: 600; margin: 0 0 4px;
}
.lede { font-size: 1.05rem; color: #3A4450; }
.hint { font-size: 0.85rem; color: var(--muted); }
.warn-text { color: var(--warn); font-size: 0.85rem; }

/* Header */
.site-head { border-bottom: 1px solid var(--line); background: var(--card); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; padding-bottom: 12px; }
.brand { font-family: "Fraunces", serif; font-weight: 650; font-size: 1.05rem; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 9px; }
.brand-mark {
  width: 20px; height: 12px; border-radius: 2px;
  background: linear-gradient(90deg, #8A3B2E 0 46%, var(--card) 46% 54%, #2E5E8A 54%);
  border: 1px solid var(--line);
}
.nav { display: flex; gap: 16px; }
.nav a { color: var(--ink); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.nav a:hover { color: var(--focus); }

/* Buttons and forms */
.btn {
  display: inline-block; padding: 9px 16px; border: 1px solid var(--ink);
  border-radius: 6px; background: var(--card); color: var(--ink);
  font: 600 0.92rem "Public Sans", sans-serif; text-decoration: none; cursor: pointer;
}
.btn:hover { background: #EDEFE9; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #2B3948; }
.btn-small { padding: 5px 10px; font-size: 0.8rem; }
.btn-tiny { padding: 2px 8px; font-size: 0.72rem; }
.btn-big { padding: 13px 22px; font-size: 1.02rem; }
.btn-danger { border-color: var(--warn); color: var(--warn); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }

.stack { display: flex; flex-direction: column; gap: 14px; max-width: 460px; }
.stack label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 0.9rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=file], select, textarea {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px;
  font: 400 1rem "Public Sans", sans-serif; background: var(--card); color: var(--ink); max-width: 100%;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.inline { display: inline; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }

.flash { padding: 10px 14px; border-radius: 6px; margin: 12px 0; font-size: 0.92rem; }
.flash-ok { background: #E4EEE7; border: 1px solid var(--deal); color: #1F4A36; }
.flash-warn { background: #F4E5E1; border: 1px solid var(--warn); color: #6E2A20; }

/* Cards, tables */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin: 14px 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }

.list-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.list-table th, .list-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.list-table th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.list-table tr:last-child td { border-bottom: none; }
.row-archived { opacity: 0.55; }

.status { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; padding: 2px 8px; border-radius: 20px; background: #E7E9E2; color: var(--muted); }
.status-open { background: #E4EEE7; color: var(--deal); }
.status-assigned { background: #E3EAF2; color: var(--focus); }
.status-debrief { background: #F0E8D8; color: #7A5C2E; }

.page-head { margin: 8px 0 4px; }
.section-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }

/* Role chips: the recurring "which side of the table" marker */
.chip {
  display: inline-block; font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--role, var(--muted)); border: 1.5px solid var(--role, var(--line));
  padding: 1px 8px; border-radius: 20px; background: #fff;
}

/* Student role card: seat assignment across the table line */
.role-card {
  background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--role, var(--ink));
  border-radius: 10px; padding: 22px 20px; margin: 18px 0;
}
.role-kicker { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.13em; color: var(--muted); font-weight: 700; margin: 0 0 2px; }
.role-name { font-family: "Fraunces", serif; font-size: 2.3rem; margin: 0 0 6px; color: var(--role, var(--ink)); }
.table-line { height: 2px; background: var(--line); margin: 16px 0 12px; position: relative; }
.table-line::after {
  content: ""; position: absolute; left: 50%; top: -4px; width: 10px; height: 10px;
  background: var(--paper); border: 2px solid var(--line); border-radius: 50%; transform: translateX(-50%);
}
.counterparts { list-style: none; padding: 0; margin: 6px 0 0; }
.counterparts li { padding: 4px 0; font-size: 1.05rem; }

.results-entry { margin-top: 22px; }
.pulse-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--deal); margin: 24px 0; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.8); } }
@media (prefers-reduced-motion: reduce) { .pulse-dot { animation: none; } }

/* Join code entry */
.code-form { display: flex; gap: 10px; margin: 16px 0; }
.code-input {
  font-family: "IBM Plex Mono", monospace; font-size: 1.5rem; letter-spacing: 0.25em;
  text-transform: uppercase; width: 165px; text-align: center;
}

/* Instructor live session */
.qr-card { text-align: center; }
.qr-holder { display: flex; justify-content: center; padding: 14px; }
.qr-holder img, .qr-holder canvas { border: 8px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.join-code { font-size: 2.4rem; font-weight: 600; margin: 8px 0 2px; }
.checkin-list { columns: 2; list-style: none; padding: 0; margin: 6px 0 16px; font-size: 0.92rem; max-height: 300px; overflow-y: auto; }
.checkin-list li { padding: 2px 0; break-inside: avoid; }

.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin: 14px 0; }
.group-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.group-card.has-result { border-color: var(--deal); }
.group-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.group-num { font-family: "Fraunces", serif; font-weight: 650; }
.member-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px dashed var(--line); flex-wrap: wrap; }
.member-name { font-weight: 600; flex: 1; }
.member-move select { font-size: 0.75rem; padding: 3px 6px; max-width: 170px; }
.holding { border-color: #C9A26A; background: #FBF7EE; }

.role-row { border-left: 4px solid var(--role, var(--line)); padding: 8px 12px; margin: 10px 0; background: #FAFAF8; border-radius: 0 8px 8px 0; }
.role-row-head { display: flex; gap: 12px; align-items: center; margin-bottom: 4px; }
.schema-row { display: flex; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.schema-row .f-label { flex: 1; min-width: 160px; }

/* Results board */
.board { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); }
.board th, .board td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 0.95rem; }
.board th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); background: #F7F8F4; }
.board-num { font-family: "Fraunces", serif; font-weight: 650; }
.board-members { font-size: 0.85rem; line-height: 1.9; }
.cell-deal { color: var(--deal); font-weight: 700; }
.cell-impasse { color: var(--warn); font-weight: 700; }
.board-meta { color: var(--muted); font-size: 0.85rem; }

/* Projector modes */
body.projector { background: var(--paper); }
.wrap-projector { max-width: 1200px; padding-top: 40px; }
.projector-join { text-align: center; }
.proj-sim { font-size: 1.3rem; color: var(--muted); margin-bottom: 0; }
.proj-title { font-family: "Fraunces", serif; font-size: 3.4rem; margin: 8px 0 20px; }
.qr-big img, .qr-big canvas { border-width: 16px; }
.proj-code { font-size: 5rem; font-weight: 600; margin: 16px 0 0; }
.proj-url { font-size: 1.4rem; color: var(--muted); margin: 4px 0 26px; }
.proj-count { font-size: 2rem; font-weight: 600; color: var(--deal); }
.projector-board .board th, .projector-board .board td { font-size: 1.25rem; padding: 12px 16px; }
.proj-board-title { font-size: 2.2rem; margin-bottom: 18px; }

.hero { margin: 26px 0 10px; }
