/* BugBot Competitions: the teacher's projector screen and the student's play screen, on top of engine.css. */

/* home */
.home { max-width: 1100px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.home h1 { font-family: 'Varela Round', sans-serif; font-weight: 400; font-size: 2rem; margin: 0 0 .5rem; }
.home .lead { color: var(--bb-secondary); max-width: 66ch; margin-bottom: 1.5rem; }
.home h2 { font-family: 'Varela Round', sans-serif; font-weight: 400; font-size: 1.45rem; margin: 2.2rem 0 .8rem; }
.comp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.1rem; }
.comp-card { border: 1px solid var(--bb-border); border-radius: 12px; padding: 1.1rem 1.2rem 1rem; background: #fff; display: flex; flex-direction: column; gap: .35rem; }
.comp-card .num { font-family: 'Roboto Mono', monospace; font-size: .75rem; color: var(--bb-secondary); letter-spacing: .05em; }
.comp-card h3 { font-family: 'Varela Round', sans-serif; font-weight: 400; margin: 0; font-size: 1.15rem; }
.comp-card p { margin: 0 0 .5rem; color: var(--bb-secondary); font-size: .92rem; flex: 1; }
.comp-card .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.comp-card .meta { font-size: .78rem; color: var(--bb-secondary); }
.btn { display: inline-block; text-decoration: none; font-weight: 700; font-size: .85rem; padding: .35rem .9rem; border-radius: 6px; border: 1px solid var(--bb-green-dark); background: #fff; color: var(--bb-dark); }
.btn.primary { background: var(--bb-green); border-color: var(--bb-green); }
.btn:hover { background: var(--bb-sage); }

/* the class session panel */
.session { border: 1px solid var(--bb-green-dark); border-radius: 12px; background: var(--bb-green); padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.session-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.session-head h2 { margin: 0; font-size: 1.2rem; }
.session-code { font-family: 'Roboto Mono', monospace; font-size: 1.3rem; letter-spacing: .2em; font-weight: 700; }
.session-head .spacer { flex: 1; }
.session-note { color: var(--bb-secondary); font-size: .9rem; margin: .4rem 0 0; }
.session-code.small { font-size: .95rem; letter-spacing: .15em; color: var(--bb-secondary); margin-left: .5rem; }
.session-start { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
.session-start input { font: inherit; padding: .35rem .6rem; border: 1px solid var(--bb-border); border-radius: 6px; flex: 1; min-width: 200px; }
.races-title { margin: 1rem 0 .2rem; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--bb-secondary); }
@media print {
  .bar, .comp-grid, .home > h2, .home .lead, .session-head button, .gl { display: none !important; }
  .session { border: 0; background: #fff; padding: 0; }
  body { color: #000; }
}
.table-wrap table { width: 100%; border-collapse: collapse; font-size: .95rem; margin-top: .6rem; }
.table-wrap th, .table-wrap td { text-align: left; padding: .3rem .6rem; border-top: 1px solid var(--bb-border); }
.table-wrap thead th { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--bb-secondary); border-top: 0; }
.table-wrap td.pts { font-family: 'Roboto Mono', monospace; font-weight: 700; text-align: right; }
.table-wrap th.pts { text-align: right; }
.table-wrap tr.me td { background: rgba(162, 197, 148, .25); font-weight: 700; }

/* host (projector) and play layouts */
.stage-page { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; max-width: 1500px; margin: 0 auto; padding: 1rem 1.25rem 3rem; }
.stage-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.stage-head h1 { font-family: 'Varela Round', sans-serif; font-weight: 400; font-size: 1.6rem; margin: 0; }
.stage-head .crumb { color: var(--bb-secondary); font-size: .85rem; }
.stage-head .spacer { flex: 1; }
.stage-main { min-width: 0; }
.stage-side { display: flex; flex-direction: column; gap: 1rem; }
.panel { border: 1px solid var(--bb-border); border-radius: 12px; background: #fff; padding: .9rem 1rem; }
.panel h3 { margin: 0 0 .5rem; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--bb-secondary); }
.panel .note { color: var(--bb-secondary); font-size: .85rem; margin: .4rem 0 0; }
.panel .err { color: var(--bb-red); }
.panel .ok { color: var(--bb-green-deep); }
.panel .actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
.panel input { font: inherit; padding: .35rem .6rem; border: 1px solid var(--bb-border); border-radius: 6px; width: 100%; margin-bottom: .4rem; }
.panel label.toggle { display: flex; align-items: center; gap: .5rem; font-size: .9rem; margin-top: .6rem; white-space: nowrap; }
.panel label.toggle input { margin: 0; width: auto; }
.roster-panel .roster { margin-bottom: .2rem; }

/* the room code, big enough for the back of the class */
.join-panel { background: #000; color: #fff; border-color: #000; }
.join-panel h3 { color: var(--bb-sage); }
.join-code { font-family: 'Roboto Mono', monospace; font-size: 2.6rem; letter-spacing: .28em; font-weight: 700; line-height: 1; margin: .2rem 0 .5rem; }
.join-url { font-size: .9rem; color: var(--bb-sage); }

/* the roster */
.roster { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.roster .person { border: 1px solid var(--bb-border); border-radius: 999px; padding: .15rem .65rem; font-size: .9rem; background: #fff; }
.roster .person.in { border-color: var(--bb-green-dark); background: var(--bb-green); }
.roster .person.me { outline: 2px solid var(--bb-green-deep); }
.roster .count { font-size: .82rem; color: var(--bb-secondary); }

/* the stage cell: on the projector the code goes away and the robot view fills the width */
.stage-page.host .cell .cell-body { grid-template-columns: minmax(0, 1fr); }
.stage-page.host .cell .CodeMirror, .stage-page.host .cell .splitter { display: none; }
.stage-page.host .cell .cell-head, .stage-page.host .cell .cell-foot .run, .stage-page.host .cell .cell-foot .bots-only, .stage-page.host .cell .cell-foot .verdict, .stage-page.host .cell .cell-foot .best { display: none; }
.stage-page.host .cell .cell-view { min-height: 62vh; border-left: 0; }
.stage-page.host .cell { margin-top: 0; }
.stage-page .cell.arena .cell-view { min-height: 420px; }
.stage-page.play .cell { margin-top: 0; }
/* the room's race is the room's: no practice buttons while in one */
.stage-page.play.in-room .cell .cell-foot .run, .stage-page.play.in-room .cell .cell-foot .bots-only { display: none; }

/* results */
.results table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.results th, .results td { text-align: left; padding: .35rem .6rem; border-top: 1px solid var(--bb-border); }
.results thead th { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--bb-secondary); border-top: 0; }
.results tr.me td { background: rgba(162, 197, 148, .25); font-weight: 700; }
.results tr.pick { cursor: pointer; }
.results tr.pick:hover td { background: var(--bb-light-bg); }
.results tr.playing td { background: rgba(162, 197, 148, .35); }
.results .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .45rem; vertical-align: middle; }
.results .pts { font-family: 'Roboto Mono', monospace; text-align: right; }
.results-title { font-weight: 700; margin: 0 0 .4rem; }
.stage-page.host .results { font-size: 1.05rem; }
.stage-page.host .leaderboard { display: none; }   /* the host's own bigger table replaces the cell's */

@media (max-width: 1000px) {
  .stage-page { grid-template-columns: 1fr; }
  .join-code { font-size: 2.2rem; }
  .stage-page.host .cell .cell-view { min-height: 50vh; }
}
