/* always hide anything marked hidden, even if display is set */
[hidden] {
    display: none !important;
}

/* the look of the game: a high school class notebook (授業ノート)
   a blackboard on top, a ruled page below, pencil letters, a red pen, rulers and stamps.
   the 4 markers have jobs: yellow = now / chosen, blue = headings, green = done / sent, red = careful.
   to change the look, change these first */
:root {
    --ink: #2d3340;
    --ink-soft: #6d7280;
    --desk: #e9e4da;
    --paper: #fdfcf7;
    --paper-edge: #b9b2a4;
    --white: #ffffff;
    --rule: #cddcec;
    --red: #d2463c;
    --red-dark: #9e2f27;
    --blue-pen: #2f5aa8;
    --blue-pen-dark: #1f3f7a;
    /* a stamp (ハンコ): vermilion (朱色), the color of a real one */
    --stamp: #d8452b;
    --marker-yellow: rgba(255, 205, 0, 0.55);
    --marker-blue: rgba(70, 150, 255, 0.35);
    --marker-green: rgba(80, 200, 120, 0.4);
    --marker-red: rgba(255, 90, 110, 0.35);
    --yellow-edge: #c9a300;
    --green-edge: #3f9a5c;
    --gray-edge: #9aa3b2;
    --sticky-yellow: #fff4b8;
    /* the sticky note that brings the words at the start of a round: its darker glued top, and its small label */
    --sticky-yellow-top: #ffec96;
    --sticky-yellow-ink: #8a7a2a;
    /* small letters on a yellow sticky note (the label of the note of what came): darker, 5.9:1 (the one above is 3.9:1) */
    --sticky-yellow-ink-dark: #6b5d16;
    /* the dark cover over the screen while the sticky note comes */
    --dim: rgba(45, 51, 64, 0.4);
    --sticky-pink: #ffe2e7;
    --sticky-blue: #dcedfd;
    --sticky-green: #e2f5d9;
    --tape: rgba(240, 220, 160, 0.75);
    --shadow: rgba(45, 51, 64, 0.22);
    /* the blackboard, its wooden frame, and the 5 colors of chalk */
    --board: #2f4a3c;
    --wood: #8a5a35;
    --chalk: #f3f0e6;
    --chalk-yellow: #f5e27a;
    --chalk-pink: #f4a7b3;
    --chalk-blue: #a9d4f5;
    --chalk-green: #b8e6a8;
    /* the cover of the notebook */
    --cover: #6f93b8;
    --cover-spine: #2d3a4f;
    --cover-light: #8aaccd;
    /* the inside of the covers (plain paper): seen when the notebook opens */
    --cover-inside: #e7ebf0;
    /* the study desk of the entrance: the wood of the top */
    --desk-wood: #d6aa72;
    --desk-wood-dark: #c4925a;
    /* the top of the desk: light from a window at the top left, and the grain of the wood running from left to right
       (thin lines a little darker and a little lighter, again and again) */
    --desk-top:
        radial-gradient(ellipse 60% 70% at 10% 0%, rgba(255, 240, 210, 0.4), transparent 70%),
        radial-gradient(ellipse 55% 60% at 100% 100%, rgba(90, 50, 15, 0.16), transparent 70%),
        repeating-linear-gradient(178deg, rgba(110, 66, 28, 0.07) 0 2px, transparent 2px 14px, rgba(255, 255, 255, 0.06) 14px 16px, transparent 16px 33px),
        repeating-linear-gradient(181deg, rgba(150, 95, 45, 0.07) 0 70px, transparent 70px 190px),
        linear-gradient(180deg, var(--desk-wood), var(--desk-wood-dark));
    /* shadows on the desk are brown, because the desk is wood */
    --desk-shadow: rgba(70, 42, 14, 0.36);
    --desk-shadow-soft: rgba(70, 42, 14, 0.2);
    /* the floor of the room around the desk of the entrance: a light beige close to --desk (the color of the other
       screens), so entering a room does not jump from wood to beige (the notebook-opening shows it too) */
    --floor: radial-gradient(ellipse at 50% 40%, #efeae0, #dcd5c8);
    /* the lines printed on the timetable (blue ink) */
    --print-blue: rgba(47, 90, 168, 0.55);
    --print-blue-light: rgba(47, 90, 168, 0.28);
    /* the pencil board (下敷き) of the streamer mode: see-through blue plastic */
    --pencil-board-tint: rgba(118, 160, 228, 0.82);
    /* a box drawn by hand: the corners are not all the same */
    --sketch: 255px 15px 225px 15px / 15px 225px 15px 255px;
    --sketch-small: 10px 3px 9px 4px / 4px 9px 3px 10px;
    --hand: "Klee One", "Zen Kaku Gothic New", "Hiragino Maru Gothic ProN", sans-serif;
    --chalk-font: "Yusei Magic", var(--hand);
    /* the smallest letters while making a message (2026-10-16 UI-12: on a phone many were 9 to 12px, and were skipped).
       a computer may write them bigger. read: the rule of the way / note: what is written beside it (the card's rule,
       the time left, the count, "相手にはこう届きます", warnings) / label: a name under a small button (a color,
       a pictogram, a flower) / tool: the names under the tools of the drawing board, in one line on a phone */
    --text-read: 14px;
    --text-note: 13px;
    --text-label: 12px;
    --text-tool: 10px;
}

/* the whole page is exactly one screen tall, so it does not scroll
   (100dvh = the height of the screen that can be seen now, even on a phone) */
html,
body {
    height: 100%;
}

html {
    background: var(--desk);
    /* (a phone or a tablet scales the page, index.html: the browser must not make the letters bigger by itself) */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* the page itself never stretches when it is pulled (2026-10-19, pineさん's iPhone: "比率が合わない". from WebKit's
   source, not seen on the iPhone: the whole page could be pulled, and in Chrome that also folds its bars away, and
   then the page is scaled again). the boxes that scroll inside keep their own stretch. (Android Chrome: no pull to
   reload on this page, which would only end a game. a computer: no swipe with 2 fingers to go back, which would leave
   the room) */
html,
body {
    overscroll-behavior: none;
}

/* two quick taps anywhere do not zoom the page (two fingers still can). a phone upright gets a page wider than the
   screen (index.html), and then iPhone and Chrome let two taps zoom it: after that, a turn kept the zoom (2026-10-18
   review). on every part, not only html: iPhone starts again from "auto" at each box that scrolls (the entrance, the
   play screen, the lists. WebKit computeUsedTouchAction). :where adds nothing to the weight of a rule, so the drawing
   boards (none) and the buttons keep their own */
:where(html, html *) {
    touch-action: manipulation;
}

body {
    font-family: var(--hand);
    font-weight: 600;
    color: var(--ink);
    background: var(--desk);
    max-width: 480px;
    height: 100dvh;
    margin: 0 auto;
    padding: 6px 10px 8px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
}

p,
dl,
dd {
    margin: 0;
}

/* ---------- the title line: small, at the top of the desk ---------- */

/* (gap 8px: 2026-10-19 "きまり" became "利用規約", 1 letter longer, and at 390px wide in a room the name got cut by
   3px. the sound button reaches 4px to each side for a finger, so 8px still keeps it off the link) */
.title-box {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 0 2px;
}

h1 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: var(--ink-soft);
    /* a narrow phone in a room (the sound button, 利用規約 and 通報 at its right): the name is cut with "…", so the line
       stays one line (2026-10-16: at 320px it broke into 2 lines, and the page got 14px shorter) */
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.terms-link {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--ink-soft);
}

/* the volume of the sound effects (game.js showSoundButtons. 2026-10-16 改良点 SE-17): a small round label drawn in
   pencil, a speaker and "音：中", at the right of the title line just before 利用規約. the line is not taller than before
   (on a short phone every pixel goes to the page): the place a finger can press is about 44px tall, ::after reaches
   over the space above and below the label.
   (2026-10-20 the title line has 設定 and, in the voice chat, マイク in the same label instead: title-pill) */
.sound-button,
.entrance-inbox-button,
.title-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 9px 1px 6px;
    font-size: 12px;
    line-height: 1.3;
    white-space: nowrap;
    color: var(--ink-soft);
    background: var(--paper);
    border: 1px solid var(--gray-edge);
    border-radius: 99px;
    box-shadow: none;
}

.sound-button::after,
.entrance-inbox-button::after,
.title-pill::after {
    content: "";
    position: absolute;
    inset: -12px -4px;
}

.sound-button .line-icon,
.entrance-inbox-button .line-icon,
.title-pill .line-icon {
    width: 16px;
    height: 16px;
    vertical-align: 0;
}

/* (the first of the labels pushes them all to the right) */
.title-box .title-pill:not([hidden]) {
    margin-left: auto;
}

.title-box .title-pill:not([hidden]) ~ .title-pill {
    margin-left: 0;
}

/* the microphone turned off in the voice chat: red, so it is seen at once */
.chat-mic-button.is-off {
    color: var(--red);
    border-color: var(--red);
}

.report-button {
    padding: 1px 8px;
    font-size: 11px;
}

/* the entrance shows the title on the cover of the notebook (game.js puts the name of the screen in data-screen) */
body[data-screen="entrance-screen"] .title-box {
    display: none;
}

/* written with the red pen, in a dashed box */
.connection-message {
    background: var(--paper);
    border: 2px dashed var(--red);
    border-radius: var(--sketch-small);
    color: var(--red);
    padding: 8px;
    text-align: center;
}

/* ---------- the parts used on many screens ---------- */

/* one screen: it takes the rest of the height */
.screen {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* a page of the notebook: ruled lines (they move with the page when it scrolls) */
.paper,
.lobby-paper,
.play-work,
.aim-box {
    background-color: var(--paper);
    background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--rule) 31px, var(--rule) 32px);
    background-attachment: local;
    border: 1px solid var(--paper-edge);
    border-radius: 6px;
}

/* the blackboard in its wooden frame. under it, the chalk tray with an eraser and 3 pieces of chalk */
.board-frame {
    position: relative;
    flex-shrink: 0;
    background: var(--wood);
    padding: 8px 8px 12px;
    border-radius: 3px;
}

.board-frame::after {
    content: "";
    position: absolute;
    left: 36px;
    bottom: 2px;
    width: 130px;
    height: 8px;
    background:
        linear-gradient(#3b3b3b, #3b3b3b) 0 0 / 40px 8px no-repeat,
        linear-gradient(to right, var(--chalk) 0 22px, transparent 22px 30px, var(--chalk-yellow) 30px 46px, transparent 46px 54px, var(--chalk-pink) 54px 68px, transparent 68px) 50px 2px / 80px 4px no-repeat;
}

/* the blackboard: written with chalk (Yusei Magic has only one weight) */
.board {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px 14px;
    background-color: var(--board);
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 6px 6px;
    color: var(--chalk);
    font-family: var(--chalk-font);
    font-weight: 400;
}

/* the first line of a board: the title on the left, a small note on the right */
.board-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

/* a small picture drawn with lines (the path is in the HTML, or made by game.js) */
.line-icon {
    width: 1.2em;
    height: 1.2em;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -0.25em;
}

/* the 4 markers: a band under the letters */
.marker-yellow {
    background: linear-gradient(transparent 55%, var(--marker-yellow) 55%);
}

.marker-blue {
    background: linear-gradient(transparent 55%, var(--marker-blue) 55%);
}

.marker-green {
    background: linear-gradient(transparent 55%, var(--marker-green) 55%);
}

.marker-red {
    background: linear-gradient(transparent 55%, var(--marker-red) 55%);
}

/* ---------- buttons: boxes drawn by hand ---------- */

button {
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    background: var(--white);
    border: 2px solid var(--ink);
    border-radius: var(--sketch);
    padding: 8px 16px;
    margin: 0;
    box-shadow: 2px 3px 0 var(--shadow);
    cursor: pointer;
    flex-shrink: 0;
    /* (two quick taps are two presses, not "zoom in" on a phone: the same as the keys of ケータイ打ち.
       zooming with two fingers still works) */
    touch-action: manipulation;
}

/* pressed: the button goes down a little */
button:active {
    transform: translate(1px, 2px);
    box-shadow: 1px 1px 0 var(--shadow);
}

button:disabled {
    opacity: 0.4;
    cursor: default;
}

/* the mark of the keyboard (Tab key): the blue pen, on every screen (2026-10-16 UI-28: the yellow one was 2.3:1 on
   the paper and 2.2:1 on a yellow sticky note, too light to find. the blue pen is 6.5:1 and 6.0:1) */
button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--blue-pen);
    outline-offset: 2px;
}

/* on the blackboard (and the strip of it over the drawing board) the blue pen cannot be seen (1.5:1): the yellow chalk */
.board :focus-visible,
.draw-topic :focus-visible {
    outline-color: var(--chalk-yellow);
}

/* small, quiet buttons: written in pencil (also the record button of 逆再生まねボイス while it is not the step to do now) */
.sub-button,
.voice-area.has-guide .record-button:not(.is-now) {
    font-size: 13px;
    padding: 5px 12px;
    border-width: 1.5px;
    border-color: var(--ink-soft);
    box-shadow: 1px 2px 0 var(--shadow);
}

/* the main buttons: painted with the red pen */
.send-button,
.start-button,
.next-button,
.new-game-button {
    color: var(--white);
    background: var(--red);
    border-color: var(--red);
    box-shadow: 0 3px 0 var(--red-dark);
}

.send-button:active,
.start-button:active,
.next-button:active,
.new-game-button:active {
    box-shadow: 0 1px 0 var(--red-dark);
}

/* 送る while nothing is made yet (game.js showSendReady): white, the red pen only on its edge and its letters, so the
   eye goes to what to do first. it is painted red the moment something is made (2026-10-16 UI-20) */
.send-button {
    transition: background-color 0.2s, color 0.2s;
}

.send-button.is-empty {
    color: var(--red);
    background: var(--white);
    box-shadow: 0 3px 0 var(--shadow);
}

/* buttons on the blackboard: written with chalk */
.chalk-button {
    font-family: var(--chalk-font);
    font-weight: 400;
    font-size: 12px;
    color: var(--chalk);
    background: transparent;
    border: 1.5px solid rgba(243, 240, 230, 0.55);
    border-radius: var(--sketch-small);
    padding: 3px 10px;
    box-shadow: none;
}

.chalk-button:active {
    box-shadow: none;
}

/* stop iPhone from zooming in when typing (needs 16px or more on the screen: --page-scale is how much a phone or a
   tablet scales the page, index.html. a sideways tablet shows the page at 0.83) */
input,
select {
    font-family: inherit;
    font-weight: 600;
    font-size: 17px;
    font-size: max(17px, calc(16.5px / var(--page-scale, 1)));
    color: var(--ink);
    padding: 8px 12px;
    width: 100%;
    box-sizing: border-box;
    background: var(--white);
    border: 2px solid var(--ink);
    border-radius: var(--sketch-small);
}

input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--blue-pen);
    outline-offset: 1px;
}

/* a row of buttons at the bottom of a screen */
.bottom-row,
.sub-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sub-row {
    justify-content: center;
    flex-wrap: wrap;
}

/* the lock, in the row under the attendance book: at the left end (the buttons go to the right).
   everyone but the host only sees it (the triangles are hidden, like on the rules note) */
.sub-row .lock-row {
    margin-right: auto;
}

.sub-row .lock-row .picker-name {
    flex: none;
    min-width: 6.5em;
}

.lobby-screen:not(.is-host) .lock-row .triangle-button {
    visibility: hidden;
}

/* ---------- entrance: a study desk (学習机) seen from above ----------
   2026-10-10 pineさん "時間割はB・他はC・すこし文房具を散らかして・ほかは整理整頓されていていい":
   the layout of design C, the timetable sheet of design B, and a few pens and an eraser left lying around
   (the designs: _資料\タイトル案_2026-10-09\). the papers and the sticky notes stay neat and straight.
   2026-10-13 pineさん "入り口をマットなしにして" (the design: _資料\画面デザイン案_2026-10-10\タイトル_マットなし.html):
   no clear mat. a wooden desk with round corners on a beige floor, the pens and the eraser lie ON the papers,
   and the red pen and the highlighter wrote a little.
   a computer: timetable | notebook | sticky notes, side by side, as big as the screen allows (no scrolling).
   a phone: one under the other (the notebook and 部屋を作る first), and the desk scrolls.
   every size is written "calc(var(--u) * N)" = N u, so the whole desk grows and shrinks together, like a photo
   that is zoomed. the rules for a phone are at the end of this part (so everything of the entrance is here).
   (".entrance-screen" in front of a rule makes it stronger than the button and box rules at the top of this file) */

/* the page itself is the floor around the desk: no edges and no width limit */
body[data-screen="entrance-screen"] {
    max-width: none;
    padding: 0;
    gap: 0;
    background: var(--floor);
}

/* "部屋に入っています…" while a room is being entered: it lies over the desk at the top
   (in the flow of the page it would make the desk shorter than u was counted for, and the desk would scroll) */
body[data-screen="entrance-screen"] .connection-message {
    position: fixed;
    top: 10px;
    left: 50%;
    z-index: 10;
    max-width: calc(100% - 32px);
    transform: translateX(-50%);
}

/* the patterns of the pictures (index.html .picture-parts): never shown, and they take no room */
.picture-parts {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* 1u = 1% of the width of the notebook (the timetable is as wide).
   on a computer, u is the smallest of: (the height fits: 147.4u + 62px) / (the width fits: 338u + 52px) /
   (not too big: 5.4px) */
.entrance-screen {
    --u: min(calc((100dvh - 62px) / 147.4), calc((100vw - 52px) / 338), 5.4px);
    position: relative;
    gap: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

/* width and height include the padding and the border (easier to count) */
.entrance-screen,
.entrance-screen *,
.entrance-screen *::before,
.entrance-screen *::after {
    box-sizing: border-box;
}

.entrance-screen h2 {
    margin: 0;
}

/* the top of the desk: a wooden board with round corners (pineさん "机の角に丸みを帯びさせて欲しい"). until 2026-10-13
   it was a clear desk mat lying on the wood (hence the name desk-mat); the board keeps the place and the size of the
   mat (the same margin and a clear border of the same width), so u and the layout stay the same.
   it fills the screen, and grows if the things on it need more room.
   (nothing is cut at its edge: the textbooks stick out of it over the floor, like real ones) */
.desk-mat {
    position: relative;
    flex: 1 0 auto;
    display: flex;
    margin: 16px;
    border: 1.5px solid transparent;
    border-radius: 26px;
    background: var(--desk-top);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        inset 0 -5px 0 rgba(90, 55, 20, 0.22),
        0 12px 26px rgba(70, 42, 14, 0.28),
        0 2px 4px rgba(70, 42, 14, 0.22);
}

/* the three things on the desk, side by side, in the middle of the screen: timetable | notebook | notes.
   (the page is written notebook-first for screen readers, but the timetable is drawn on the left: order)
   a grid of one row: the timetable and the notebook are as tall as the row (stretch), so they are always
   the same size, even when the words make the timetable a little taller on a small screen.
   the layers: the papers and the notes 4 < the pencil, the eraser and the red pen 6,
   so they lie on the papers (but only where a paper has no words) */
.mat-layout {
    flex: 1;
    display: grid;
    grid-template-columns: auto auto auto;
    justify-content: center;
    align-content: center;
    align-items: center;
    column-gap: calc(var(--u) * 8);
    padding: calc(var(--u) * 3) calc(var(--u) * 8);
}

/* ---------- the timetable (時間割): how to play (design B) ----------
   an A4 sheet as big as the notebook, lying on the desk: printed in blue, folded once across the middle */

/* the place of the timetable. the pencil lies on its left margin */
.timetable-spot {
    position: relative;
    order: 1;
    align-self: stretch;
    display: flex;
    flex-direction: column;
}

/* (min-height: the words may make it a little taller on a small screen, but never shorter than A4) */
.timetable {
    position: relative;
    z-index: 4;
    flex: 1;
    width: calc(var(--u) * 100);
    min-height: calc(var(--u) * 141.4);
    display: flex;
    flex-direction: column;
    gap: calc(var(--u) * 2.8);
    padding: calc(var(--u) * 5.4) calc(var(--u) * 6.2) calc(var(--u) * 5.1);
    border-radius: calc(var(--u) * 0.4);
    background:
        /* the fold across the middle (it was folded in half in a bag) */
        linear-gradient(180deg, rgba(0, 0, 0, 0) 49.4%, rgba(90, 70, 40, 0.07) 50%, rgba(255, 255, 255, 0.9) 50.35%, rgba(0, 0, 0, 0) 51.2%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 49%, rgba(120, 100, 60, 0.05) 50%, rgba(255, 255, 255, 0) 100%),
        radial-gradient(ellipse at 15% 8%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0) 50%),
        var(--paper);
    /* the light comes from the window at the top left, so the shadow falls to the bottom right */
    box-shadow:
        calc(var(--u) * 0.7) calc(var(--u) * 1.1) calc(var(--u) * 2) var(--desk-shadow),
        calc(var(--u) * 0.15) calc(var(--u) * 0.2) calc(var(--u) * 0.3) var(--desk-shadow-soft);
}

.timetable-title {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: calc(var(--u) * 0.85);
    font-size: calc(var(--u) * 4);
    font-weight: 400;
    color: var(--blue-pen-dark);
}

/* じかんわり: a heading, so it gets the blue marker */
.timetable-title-main {
    padding: 0 calc(var(--u) * 1.1);
    font-family: var(--chalk-font);
    font-size: calc(var(--u) * 7.6);
    background: linear-gradient(transparent 60%, var(--marker-blue) 60%, var(--marker-blue) 92%, transparent 92%);
}

.timetable-title-sub {
    font-weight: 600;
    font-size: max(11px, calc(var(--u) * 4));
}

/* a little clock drawn with the blue pen, next to the heading */
.timetable-clock {
    position: absolute;
    top: calc(var(--u) * 4.8);
    right: calc(var(--u) * 6.2);
    width: calc(var(--u) * 8.5);
    height: calc(var(--u) * 8.5);
    color: var(--blue-pen);
    opacity: 0.8;
}

/* the table: printed blue lines, all the rows the same height */
.timetable-rows {
    flex: 1;
    display: grid;
    grid-auto-rows: 1fr;
    margin: 0;
    padding: 0;
    list-style: none;
    background: rgba(255, 255, 255, 0.4);
    border: max(1px, calc(var(--u) * 0.42)) solid var(--print-blue);
    border-radius: calc(var(--u) * 1.1);
    overflow: hidden;
}

.period-row {
    display: grid;
    grid-template-columns: calc(var(--u) * 18.4) minmax(0, 1fr);
    min-height: 0;
}

.period-row + .period-row {
    border-top: max(1px, calc(var(--u) * 0.25)) solid var(--print-blue-light);
}

/* the left cell: "1 時間目" printed in blue */
.period {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    color: var(--blue-pen);
    background: rgba(70, 150, 255, 0.08);
    border-right: max(1px, calc(var(--u) * 0.25)) solid var(--print-blue-light);
}

.period-number {
    font-family: var(--chalk-font);
    font-weight: 400;
    font-size: calc(var(--u) * 6.5);
}

.period-word {
    font-size: max(10px, calc(var(--u) * 3));
    letter-spacing: 0.05em;
}

/* 放課後: only the word, a little bigger */
.period-word.is-word-only {
    font-size: max(11px, calc(var(--u) * 4));
}

/* the right cell: what we do in that lesson */
.lesson {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: calc(var(--u) * 0.57);
    min-width: 0;
    padding: calc(var(--u) * 1.1) calc(var(--u) * 3.4);
}

.lesson-name {
    font-size: max(12px, calc(var(--u) * 4.5));
    line-height: 1.25;
}

.lesson-text {
    font-size: max(10.5px, calc(var(--u) * 3.25));
    line-height: 1.42;
    color: var(--ink-soft);
}

/* 放課後: the end of the day (green = done) */
.is-after-school .period {
    color: #3d7a46;
    background: rgba(90, 190, 90, 0.12);
}

/* the notes under the table: how many people, and the room */
.timetable-notes {
    display: flex;
    flex-direction: column;
    gap: calc(var(--u) * 1.4);
    padding: calc(var(--u) * 2.3) calc(var(--u) * 2.8);
    border: max(1px, calc(var(--u) * 0.25)) dashed var(--print-blue-light);
    border-radius: calc(var(--u) * 1.1);
}

.note-line {
    display: flex;
    align-items: center;
    gap: calc(var(--u) * 2.3);
}

/* a small printed tag */
.note-line dt {
    flex-shrink: 0;
    padding: calc(var(--u) * 0.3) calc(var(--u) * 1.7);
    font-size: max(10px, calc(var(--u) * 3));
    color: var(--blue-pen);
    background: rgba(70, 150, 255, 0.08);
    border: max(1px, calc(var(--u) * 0.28)) solid var(--print-blue);
    border-radius: calc(var(--u) * 0.7);
}

.note-line dd {
    font-size: max(11px, calc(var(--u) * 3.4));
}

/* ---------- the things left lying around (pineさん "すこし文房具を散らかして") ----------
   only pictures, turned a little. they lie ON the papers (z-index 6 is above the papers and the notes, 4:
   pineさん 2026-10-10 "えんぴつはレイヤーを上に"), but only where a paper has no words: its margin, its spine,
   or the desk */

/* a red-and-blue pencil (赤青鉛筆): its lower end lies on the left margin of the timetable */
.desk-pencil {
    position: absolute;
    z-index: 6;
    top: calc(var(--u) * 58);
    right: calc(100% - var(--u) * 1);
    width: calc(var(--u) * 3.4);
    height: calc(var(--u) * 48.6);
    transform: rotate(-16deg);
    filter: drop-shadow(calc(var(--u) * 0.6) calc(var(--u) * 0.9) calc(var(--u) * 0.6) var(--desk-shadow));
}

/* a big thick eraser on the spine of the notebook, and its crumbs (pineさん "消しゴムをもう少し太い消しゴムにして") */
.desk-eraser {
    position: absolute;
    z-index: 6;
    left: calc(var(--u) * -13);
    bottom: calc(var(--u) * -3.5);
    width: calc(var(--u) * 26);
    height: calc(var(--u) * 15.6);
    transform: rotate(-14deg);
    filter: drop-shadow(calc(var(--u) * 0.5) calc(var(--u) * 0.8) calc(var(--u) * 0.6) var(--desk-shadow-soft));
}

/* a red pen with its cap on, across the bottom edge of the notebook (inside the desk: its edge would cut it) */
.desk-red-pen {
    position: absolute;
    z-index: 6;
    right: calc(var(--u) * -7);
    bottom: calc(var(--u) * -4);
    width: calc(var(--u) * 40);
    height: calc(var(--u) * 3.2);
    transform: rotate(-6deg);
    filter: drop-shadow(calc(var(--u) * 0.5) calc(var(--u) * 0.8) calc(var(--u) * 0.6) var(--desk-shadow));
}

/* what the red pen wrote: a はなまる at the top right corner of the white label of the notebook (next to
   the small 伝言ゲーム, never on it), and a circle drawn by hand around "3〜8人" on the timetable (its corners are not
   all the same). (the yellow highlighter on "ひらがな・カタカナ" is the shared .marker-yellow) */
.red-hanamaru {
    position: absolute;
    top: calc(var(--u) * -3.5);
    right: calc(var(--u) * -4.5);
    width: calc(var(--u) * 15);
    height: calc(var(--u) * 15);
    fill: none;
    stroke: var(--red);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.9;
    transform: rotate(-12deg);
    pointer-events: none;
}

.red-circle {
    position: relative;
    white-space: nowrap;
}

.red-circle::after {
    content: "";
    position: absolute;
    inset: -0.3em -0.45em;
    border: max(1.5px, calc(var(--u) * 0.4)) solid var(--red);
    border-radius: 52% 48% 55% 45% / 58% 50% 50% 42%;
    opacity: 0.85;
    transform: rotate(-5deg);
    pointer-events: none;
}

/* ---------- the notebook (B5): lying on the desk, as big as the timetable ---------- */

/* the place of the notebook (in the row of the desk). the eraser and the red pen lie near it */
.cover-spot {
    position: relative;
    order: 2;
    align-self: stretch;
    display: flex;
    flex-direction: column;
}

/* the notebook: a blue cover. its edge shows the white pages under it, and it makes a shadow on the desk.
   (the notebook-opening turns this cover: game.js openNotebook finds it by "cover") */
.cover {
    position: relative;
    z-index: 4;
    flex: 1;
    width: calc(var(--u) * 100);
    min-height: calc(var(--u) * 141.4);
    display: flex;
    flex-direction: column;
    padding: calc(var(--u) * 7) calc(var(--u) * 7) calc(var(--u) * 5) calc(var(--u) * 13);
    background:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 6px),
        linear-gradient(155deg, var(--cover-light), var(--cover) 55%, #5f84ab);
    border-radius: calc(var(--u) * 0.8) calc(var(--u) * 1.6) calc(var(--u) * 1.6) calc(var(--u) * 0.8);
    box-shadow:
        calc(var(--u) * 0.4) calc(var(--u) * 0.4) 0 #f1ede2,
        calc(var(--u) * 0.7) calc(var(--u) * 0.7) 0 #d9d3c4,
        calc(var(--u) * 1.2) calc(var(--u) * 2.2) calc(var(--u) * 3.6) var(--desk-shadow);
}

/* the spine: dark cloth tape on the left */
.cover::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: calc(var(--u) * 6.5);
    background:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 3px),
        linear-gradient(90deg, #22304a, var(--cover-spine) 40%, #3a4963);
    border-radius: calc(var(--u) * 0.8) 0 0 calc(var(--u) * 0.8);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.15);
}

.cover-label {
    padding-bottom: calc(var(--u) * 2);
    font-size: max(10px, calc(var(--u) * 3));
    letter-spacing: 0.32em;
    color: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

/* the white label on the cover, in the middle (margin-block: auto = the same space above and below).
   a thin blue frame is printed inside it (the 2 inset shadows). (relative: the はなまる is placed on its corner) */
.cover-sheet {
    position: relative;
    margin-block: auto;
    display: flex;
    flex-direction: column;
    padding: calc(var(--u) * 6) calc(var(--u) * 6) calc(var(--u) * 5);
    background: var(--paper);
    border-radius: calc(var(--u) * 0.6);
    box-shadow:
        inset 0 0 0 calc(var(--u) * 1.2) var(--paper),
        inset 0 0 0 calc(var(--u) * 1.2 + 1px) rgba(47, 90, 168, 0.35),
        0 1px 2px rgba(0, 0, 0, 0.12);
}

.cover-title {
    font-weight: 400;
    line-height: 1.2;
}

/* 伝言ゲーム: handwriting, with the yellow marker on it */
.cover-title-sub {
    padding: 0 calc(var(--u) * 0.6);
    font-weight: 600;
    font-size: calc(var(--u) * 8.4);
    background: linear-gradient(180deg, transparent 48%, var(--marker-yellow) 48% 90%, transparent 90%);
}

/* でんぶんかんぷん (the name): big, written with a felt-tip marker (Yusei Magic: its name means 油性マジック).
   two lines, でんぶん / かんぷん, so that it never breaks in the middle of a half (2026-10-21) */
.cover-title-main {
    font-family: var(--chalk-font);
    font-size: calc(var(--u) * 12.6);
}

.cover-catch {
    margin-top: calc(var(--u) * 3);
    font-size: max(11px, calc(var(--u) * 3.6));
    color: var(--ink-soft);
}

/* the Name line: write the nickname on the printed line */
.cover-name {
    display: flex;
    flex-direction: column;
    gap: calc(var(--u) * 1.2);
    margin-top: calc(var(--u) * 7);
}

.profile-row {
    display: flex;
    align-items: baseline;
    gap: calc(var(--u) * 2.4);
    border-bottom: 1.5px solid #59606e;
}

/* while writing, the line gets the yellow marker (yellow = now) */
.profile-row:focus-within {
    border-bottom-color: var(--blue-pen);
    background: linear-gradient(180deg, transparent 55%, rgba(255, 205, 0, 0.28) 55%);
}

.cover-name-head {
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-weight: 400;
    font-size: calc(var(--u) * 4.6);
    color: var(--ink-soft);
}

/* the box is the printed line itself (no frame).
   16px or more: an iPhone zooms in when typing in smaller letters (a big iPhone held sideways is 900px wide or
   more, so it gets the computer layout, where u is small) */
.entrance-screen .name-input {
    flex: 1;
    min-width: 0;
    width: auto;
    padding: calc(var(--u) * 0.8) calc(var(--u) * 0.6);
    font-size: max(16px, calc(var(--u) * 5.4));
    font-size: max(calc(16.5px / var(--page-scale, 1)), calc(var(--u) * 5.4));
    background: transparent;
    border: none;
    border-radius: 0;
}

/* (the line shows where you are writing, so the box needs no outline) */
.entrance-screen .name-input:focus {
    outline: none;
}

.entrance-screen .name-input::placeholder {
    color: #a3a7b1;
}

.cover-name-note {
    font-size: max(10.5px, calc(var(--u) * 2.7));
    color: var(--ink-soft);
}

.height-note {
    margin-top: calc(var(--u) * 1.6);
    font-size: max(10.5px, calc(var(--u) * 2.7));
    color: var(--ink-soft);
}

/* the small print at the bottom of the cover */
.cover-ruled {
    padding-top: calc(var(--u) * 1.6);
    font-size: max(10px, calc(var(--u) * 2.8));
    letter-spacing: 0.1em;
    text-align: right;
    color: rgba(255, 255, 255, 0.85);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

/* ---------- the right side: the pencil case, the sticky notes (the buttons), the note about safety ---------- */

.note-area {
    order: 3;
    width: calc(var(--u) * 104);
    display: flex;
    flex-direction: column;
    gap: calc(var(--u) * 3);
    margin-left: calc(var(--u) * 2);
}

/* the place of the pencil case (only a picture) */
.pencil-case-spot {
    position: relative;
    z-index: 3;
    height: calc(var(--u) * 24);
}

/* the pencil case: zipped cloth, a little open, with pens peeking out. lying a little turned */
.pencil-case {
    position: absolute;
    left: calc(var(--u) * -1);
    bottom: 0;
    width: calc(var(--u) * 66);
    height: calc(var(--u) * 24.4);
    transform: rotate(-3deg);
    filter: drop-shadow(calc(var(--u) * 0.6) calc(var(--u) * 1.2) calc(var(--u) * 1) var(--desk-shadow));
}

/* the sticky notes, on a grid:
     [ the pad: 部屋を作る ] [ ひとりで試す ]
     [                    ] [ 配信モード   ]
     [ 合言葉で入る (long)                ]
   (2 equal columns, not 56u and 44u like design C: "配信モード" and its ON / OFF sign need about 39u,
   and went out of the narrow note on a small computer screen) */
.note-cluster {
    position: relative;
    z-index: 4;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows:
        minmax(calc(var(--u) * 19), auto)
        minmax(calc(var(--u) * 19), auto)
        minmax(calc(var(--u) * 22), auto);
    grid-template-areas:
        "pad solo"
        "pad streamer"
        "join join";
    gap: calc(var(--u) * 4);
}

/* one sticky note (付せん). not turned: straight. the glue is at the top, so the top is a little darker */
.entrance-screen .sticky-note {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: calc(var(--u) * 0.8);
    min-width: 0;
    margin: 0;
    padding: calc(var(--u) * 2.6) calc(var(--u) * 3);
    font-size: calc(var(--u) * 4);
    font-weight: 600;
    color: var(--ink);
    text-align: left;
    border: none;
    border-radius: 1px 1px 2px 2px;
    background-image: linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0) 24%);
    box-shadow: 0 calc(var(--u) * 0.5) calc(var(--u) * 1.2) var(--desk-shadow-soft);
}

/* the notes that are buttons: they rise a little under the mouse, and go down when pressed */
.entrance-screen button.sticky-note {
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.entrance-screen button.sticky-note:not(:disabled):hover {
    transform: translateY(calc(var(--u) * -0.5));
    box-shadow: 0 calc(var(--u) * 1.4) calc(var(--u) * 2.4) var(--desk-shadow-soft);
}

.entrance-screen button.sticky-note:not(:disabled):active {
    transform: translateY(calc(var(--u) * 0.2));
    box-shadow: 0 calc(var(--u) * 0.3) calc(var(--u) * 0.8) var(--desk-shadow-soft);
}

/* the first line of a note: a small picture and the words */
.note-head {
    display: flex;
    align-items: center;
    gap: calc(var(--u) * 1.4);
    width: 100%;
}

/* a picture drawn with lines only (like the pictures of the ways in the game) */
.note-icon {
    flex: none;
    width: calc(var(--u) * 4.8);
    height: calc(var(--u) * 4.8);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.note-main {
    font-family: var(--chalk-font);
    font-weight: 400;
    font-size: calc(var(--u) * 4.6);
    line-height: 1.25;
    white-space: nowrap;
}

.note-sub {
    font-size: max(11px, calc(var(--u) * 3.1));
    line-height: 1.4;
    color: var(--ink-soft);
}

/* --- 部屋を作る: the top sheet of a pad of sticky notes (the most important button) ---
   the sheets under it show at its bottom edge (the stripes of the shadows),
   and its bottom right corner is a little lifted (the last gradient) */
.entrance-screen .room-pad {
    grid-area: pad;
    padding: calc(var(--u) * 4) calc(var(--u) * 4.4);
    color: var(--blue-pen-dark);
    background-color: var(--sticky-yellow);
    background-image:
        linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0) 22%),
        linear-gradient(315deg, rgba(160, 120, 0, 0.14) 0, rgba(255, 255, 255, 0) calc(var(--u) * 7));
    box-shadow:
        0 calc(var(--u) * 0.4) 0 #efe09a,
        0 calc(var(--u) * 0.8) 0 #fff1ad,
        0 calc(var(--u) * 1.2) 0 #e9d98e,
        0 calc(var(--u) * 1.6) 0 #fdeea6,
        0 calc(var(--u) * 2) 0 #e2d083,
        0 calc(var(--u) * 3) calc(var(--u) * 2.6) var(--desk-shadow);
}

/* the pad does not rise (it is stuck to the desk): only its top sheet gets brighter */
.entrance-screen button.room-pad:not(:disabled):hover,
.entrance-screen button.room-pad:active {
    transform: none;
    background-color: #fff8cf;
    box-shadow:
        0 calc(var(--u) * 0.4) 0 #efe09a,
        0 calc(var(--u) * 0.8) 0 #fff1ad,
        0 calc(var(--u) * 1.2) 0 #e9d98e,
        0 calc(var(--u) * 1.6) 0 #fdeea6,
        0 calc(var(--u) * 2) 0 #e2d083,
        0 calc(var(--u) * 3.6) calc(var(--u) * 3.4) var(--desk-shadow);
}

.room-pad .note-icon {
    width: calc(var(--u) * 6);
    height: calc(var(--u) * 6);
}

.room-pad .note-main {
    font-size: calc(var(--u) * 7.4);
}

.room-pad .note-sub {
    font-size: max(12px, calc(var(--u) * 3.6));
}

/* --- ひとりで試す --- */
.entrance-screen .solo-note {
    grid-area: solo;
    background-color: var(--sticky-green);
}

.solo-note .note-icon {
    color: var(--green-edge);
}

/* --- 配信モード: on / off (game.js writes ON / OFF in the small sign) --- */
.entrance-screen .streamer-note {
    grid-area: streamer;
    background-color: var(--sticky-pink);
}

.streamer-note .note-icon {
    color: var(--red);
}

/* the small ON / OFF sign at the right end of the first line */
.streamer-state {
    flex: none;
    margin-left: auto;
    padding: 0 calc(var(--u) * 1.2);
    font-size: max(10px, calc(var(--u) * 2.8));
    letter-spacing: 0.08em;
    color: var(--ink-soft);
    border: 1px solid rgba(45, 51, 64, 0.4);
    border-radius: 99px;
}

/* while streaming: the note looks pressed, and the sign says ON with the yellow marker (yellow = now) */
.is-streamer .entrance-screen .streamer-note,
.is-streamer .entrance-screen button.streamer-note:not(:disabled):hover {
    transform: none;
    background-color: #ffd2db;
    box-shadow: inset 0 calc(var(--u) * 0.4) calc(var(--u) * 1) rgba(150, 40, 60, 0.18);
}

.is-streamer .streamer-state {
    color: var(--ink);
    background: var(--marker-yellow);
    border-color: var(--yellow-edge);
}

/* --- 合言葉で入る: a long note. the words | the box for the code | the button ---
   (the words get 34u, not 28u like design C: "合言葉で入る" with its picture needs about 33u, and broke into 2 lines) */
.entrance-screen .join-note {
    grid-area: join;
    display: grid;
    grid-template-columns: calc(var(--u) * 34) minmax(0, 1fr) calc(var(--u) * 15);
    align-items: center;
    column-gap: calc(var(--u) * 3);
    padding: calc(var(--u) * 2.6) calc(var(--u) * 4);
    background-color: var(--sticky-blue);
}

.join-label {
    display: flex;
    flex-direction: column;
    gap: calc(var(--u) * 0.4);
    color: var(--blue-pen-dark);
    cursor: pointer;
}

.join-label .note-head {
    gap: calc(var(--u) * 1);
}

.join-label .note-icon {
    width: calc(var(--u) * 4.2);
    height: calc(var(--u) * 4.2);
}

/* the place of the box. the pencil board slides over it */
.room-slot {
    position: relative;
    display: block;
}

/* (16px or more, like the nickname) */
.entrance-screen .room-input {
    display: block;
    width: 100%;
    padding: calc(var(--u) * 0.6) calc(var(--u) * 1.4);
    font-size: max(16px, calc(var(--u) * 5.2));
    font-size: max(calc(16.5px / var(--page-scale, 1)), calc(var(--u) * 5.2));
    letter-spacing: 0.3em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.6);
    border: none;
    border-bottom: calc(var(--u) * 0.4) solid var(--ink);
    border-radius: calc(var(--u) * 0.6) calc(var(--u) * 0.6) 0 0;
}

.entrance-screen .room-input::placeholder {
    font-size: 0.8em;
    letter-spacing: 0.1em;
    color: #8a94a6;
}

/* 入る: a film index flag (a clear film with a green tip). the word is on the clear part */
.entrance-screen .join-button {
    height: calc(var(--u) * 9);
    padding: 0 0 0 30%;
    font-size: calc(var(--u) * 4.2);
    color: var(--ink);
    background: linear-gradient(90deg, #7cc792 0 30%, rgba(255, 255, 255, 0.72) 30% 100%);
    border: 1px solid rgba(63, 154, 92, 0.55);
    border-radius: calc(var(--u) * 0.6);
    box-shadow: 0 calc(var(--u) * 0.4) calc(var(--u) * 0.8) var(--desk-shadow-soft);
    transition: transform 0.15s ease;
}

.entrance-screen .join-button:not(:disabled):hover {
    transform: translateY(calc(var(--u) * -0.3));
}

.entrance-screen .join-button:not(:disabled):active {
    transform: translateY(calc(var(--u) * 0.2));
    box-shadow: 0 calc(var(--u) * 0.2) calc(var(--u) * 0.4) var(--desk-shadow-soft);
}

/* --- the pencil board (下敷き) for streamer mode (2026-10-09 pineさん "配信モードは下敷きで隠すようにアニメーションを") ---
   see-through blue plastic with a soft shine and a ruler scale on its edge.
   OFF: it lies at the right of the note, a little turned, mostly outside the screen (only a very wide screen,
   about 2200px or more, shows all of it on the desk).
   ON (body.is-streamer): it slides left over the box, and the blur behind it (backdrop-filter) hides the code.
   pointer-events: none = you can still click the box under it and type (the code stays hidden) */
.pencil-board {
    position: absolute;
    z-index: 5;
    inset: calc(var(--u) * -8) calc(var(--u) * -2);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: calc(var(--u) * 1.4);
    background:
        linear-gradient(112deg, rgba(255, 255, 255, 0) 22%, rgba(255, 255, 255, 0.5) 30%, rgba(255, 255, 255, 0) 40%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 7px),
        var(--pencil-board-tint);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
    box-shadow:
        0 calc(var(--u) * 0.8) calc(var(--u) * 2.2) rgba(25, 40, 80, 0.3),
        inset 0 0 0 calc(var(--u) * 0.3) rgba(255, 255, 255, 0.18);
    pointer-events: none;
    transform-origin: left center;
    transform: translateX(calc(100% + var(--u) * 22)) rotate(5deg);
    transition: transform 0.7s cubic-bezier(0.2, 0.85, 0.25, 1);
}

.is-streamer .pencil-board {
    transform: translateX(0) rotate(0deg);
}

/* the ruler scale printed along the bottom edge of the board (long and short lines) */
.pencil-board::before {
    content: "";
    position: absolute;
    left: calc(var(--u) * 1.6);
    right: calc(var(--u) * 1.6);
    bottom: calc(var(--u) * 0.8);
    height: calc(var(--u) * 2.2);
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.85) 0 1px, transparent 1px calc(var(--u) * 4.2)) left bottom / 100% 100% no-repeat,
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.6) 0 1px, transparent 1px calc(var(--u) * 0.84)) left bottom / 100% 45% no-repeat;
}

/* a flash of light that runs over the board once, when it arrives */
.pencil-board::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.65) 50%, transparent 65%);
    background-size: 250% 100%;
    background-position: 120% 0;
    opacity: 0;
}

.is-streamer .pencil-board::after {
    animation: board-shine 0.9s 0.55s ease-out;
}

@keyframes board-shine {
    0% {
        opacity: 1;
        background-position: 120% 0;
    }
    100% {
        opacity: 1;
        background-position: -60% 0;
    }
}

/* the words on the board: they appear after it has arrived */
.board-print {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: calc(var(--u) * 0.4);
    color: var(--white);
    text-shadow: 0 1px 2px rgba(20, 40, 90, 0.45);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.is-streamer .board-print {
    opacity: 1;
    transition-delay: 0.45s;
}

.board-big {
    font-family: var(--chalk-font);
    font-size: calc(var(--u) * 4.8);
    letter-spacing: 0.2em;
    line-height: 1.1;
}

.board-small {
    font-size: max(10px, calc(var(--u) * 2.6));
    letter-spacing: 0.05em;
}

/* a browser without the blur: the plastic is almost not see-through, so the code is still hidden */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .pencil-board {
        background-color: rgba(118, 160, 228, 0.97);
    }
}

/* --- a message (for example "合言葉は6文字です"): written with the dark red pen on a strip of paper, stuck on the
   long note right under the code box (2026-10-16 UI-4: at the bottom of the entrance it was out of a phone's screen).
   it takes the whole width of the note (grid-column 1 / -1), and lies over the pencil board of the streamer mode
   (z-index 6 > 5), so it is never blurred. (the dark red: 7.1:1 on the paper, the red was 4.4:1 for small letters) --- */
.entrance-message {
    position: relative;
    z-index: 6;
    grid-column: 1 / -1;
    margin-top: calc(var(--u) * 2);
    padding: calc(var(--u) * 1.4) calc(var(--u) * 3);
    font-size: max(12px, calc(var(--u) * 3.4));
    line-height: 1.5;
    color: var(--red-dark);
    background: var(--paper);
    box-shadow: 0 calc(var(--u) * 0.4) calc(var(--u) * 1) var(--desk-shadow-soft);
}

.entrance-message:empty {
    display: none;
}

/* the code typed is wrong: the box gets a frame of the red pen (game.js showEntranceMessage, which also shakes it
   a little. typing again takes the frame away). (box-shadow: the blue focus mark is the outline, so both show) */
.room-slot.is-wrong .room-input {
    border-bottom-color: var(--red);
    box-shadow: 0 0 0 2px var(--red);
}

/* --- the note about safety: a strip of ruled paper, with a red line at the left (red = careful) --- */
.entrance-note {
    position: relative;
    z-index: 4;
    padding: calc(var(--u) * 1.4) calc(var(--u) * 3) calc(var(--u) * 1.4) calc(var(--u) * 6);
    font-size: max(11px, calc(var(--u) * 3));
    line-height: 1.7;
    /* (no line starts with "ー": 2026-10-19, "利用規約とプライバシ / ーを読んでください" at 390px wide) */
    line-break: strict;
    color: var(--ink-soft);
    background-color: var(--paper);
    background-image:
        linear-gradient(90deg, transparent calc(var(--u) * 4), rgba(210, 70, 60, 0.6) calc(var(--u) * 4) calc(var(--u) * 4 + 1px), transparent 0),
        repeating-linear-gradient(180deg, transparent 0 calc(1.7em - 1px), var(--rule) calc(1.7em - 1px) 1.7em);
    background-position: 0 0, 0 calc(var(--u) * 1.4);
    box-shadow: 0 calc(var(--u) * 0.4) calc(var(--u) * 1) var(--desk-shadow-soft);
}

.entrance-note a {
    color: var(--blue-pen);
    text-underline-offset: 0.2em;
}

/* the volume of the sound effects, at the end of the note (the same button as in the title line of the other screens:
   the notebook makes a sound when it opens, so it can be turned off here first). as big as the letters of the note,
   and lower than its ruled lines, so the note keeps its height; a finger can press a little above and below it */
.entrance-note .sound-button,
.entrance-note .entrance-inbox-button {
    margin-left: calc(var(--u) * 1.5);
    padding: 0 calc(var(--u) * 2) 0 calc(var(--u) * 1.2);
    font-size: inherit;
    line-height: 1.45;
    vertical-align: 0.1em;
}

.entrance-note .sound-button::after,
.entrance-note .entrance-inbox-button::after {
    inset: -8px -4px;
}

/* (the link of the line above stays on top of that place: a tap on its letters opens 利用規約, not the volume) */
.entrance-note a {
    position: relative;
    z-index: 1;
}

.entrance-note .sound-button .line-icon,
.entrance-note .entrance-inbox-button .line-icon {
    width: 1.3em;
    height: 1.3em;
}

/* a notice about a change of the terms (2026-10-23, notice.js): its own line at the top of the note, in the red pen */
.entrance-notice {
    display: block;
    color: var(--red-dark);
}

.terms-notice-head {
    color: var(--red);
}

/* --- a clear ruler at the bottom, left a little askew (only a picture) --- */
.desk-tools {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: calc(var(--u) * 3);
    padding-left: calc(var(--u) * 1);
}

/* a 15 cm ruler: 1 cm = 4u. the lines are 2 gradients (every 1 cm long, every 5 mm short) */
.desk-ruler {
    position: relative;
    flex: none;
    width: calc(var(--u) * 66);
    height: calc(var(--u) * 9);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: calc(var(--u) * 0.8);
    background-color: rgba(255, 255, 255, 0.32);
    background-image:
        repeating-linear-gradient(90deg, rgba(45, 51, 64, 0.6) 0 1px, transparent 1px calc(var(--u) * 4)),
        repeating-linear-gradient(90deg, rgba(45, 51, 64, 0.4) 0 1px, transparent 1px calc(var(--u) * 2));
    background-size: calc(var(--u) * 60 + 1px) 42%, calc(var(--u) * 60 + 1px) 24%;
    background-position: calc(var(--u) * 3) 0, calc(var(--u) * 3) 0;
    background-repeat: no-repeat;
    box-shadow: 0 calc(var(--u) * 0.6) calc(var(--u) * 1.2) var(--desk-shadow-soft);
    transform: rotate(-4deg);
}

/* the numbers on the ruler: 0, 5, 10, 15 */
.desk-ruler span {
    position: absolute;
    bottom: calc(var(--u) * 0.6);
    transform: translateX(-50%);
    font-size: max(8px, calc(var(--u) * 2.4));
    line-height: 1;
    color: rgba(45, 51, 64, 0.7);
}

.desk-ruler span:nth-child(1) {
    left: calc(var(--u) * 3);
}

.desk-ruler span:nth-child(2) {
    left: calc(var(--u) * 23);
}

.desk-ruler span:nth-child(3) {
    left: calc(var(--u) * 43);
}

.desk-ruler span:nth-child(4) {
    left: calc(var(--u) * 63);
}

/* ---------- textbooks stacked under the pencil case (only a picture) ----------
   their corners are under the top right of the case (it lies on them), and the books go up and to the right out of
   the picture (overflow: visible), over the edge of the desk: only the edge of the screen cuts them.
   (in the place of the pencil case, so they stay next to it on every screen. 1 unit of the picture = 0.25u) */
.book-stack {
    position: absolute;
    left: calc(var(--u) * 49.5);
    top: calc(var(--u) * -25);
    width: calc(var(--u) * 40);
    height: calc(var(--u) * 34);
    overflow: visible;
    pointer-events: none;
}

/* ---------- the notebook opens when entering a room (game.js openNotebook) ----------
   a copy of the desk is laid over everything. it comes closer (transform from its top left corner),
   then the cover and the pages turn on their left edge. behind the copy is the floor, as on the entrance
   (the copy has the round wooden desk in it) */
.notebook-opening {
    position: fixed;
    inset: 0;
    z-index: 30;
    overflow: hidden;
    pointer-events: none;
    background: var(--floor);
}

/* (overflow: visible = the copy is the whole desk, not a scrolled box: see game.js openNotebook) */
.entrance-screen.opening-desk {
    position: absolute;
    margin: 0;
    overflow: visible;
    transform-origin: 0 0;
}

/* (in the copy, the flash of the pencil board would run again in streamer mode) */
.notebook-opening .pencil-board::after {
    animation: none;
}

.cover.is-turning {
    z-index: 20;
    transform-origin: left center;
}

/* the copy of the cover that turns, lying on the copy of the desk at the place of the notebook
   (game.js openNotebook sets its place and size), so the round edge of the desk does not cut it off */
.cover.is-lifted {
    position: absolute;
    min-height: 0;
    margin: 0;
}

/* the eraser and the red pen in the copy: above the turning cover until they go away (game.js openNotebook) */
.desk-eraser.is-on-top,
.desk-red-pen.is-on-top {
    z-index: 25;
}

/* the cover after it turned past the middle: we see its inside (plain paper), not its front */
.cover.is-inside {
    background: var(--cover-inside);
}

/* the back cover, under the pages: we see its inside too. (the pages turned to the left lie on the front cover,
   the pages still on the right lie on this one) */
.opening-back {
    position: absolute;
    z-index: 3;
    background: var(--cover-inside);
    border-radius: 0 calc(var(--u) * 1.6) calc(var(--u) * 1.6) 0;
    box-shadow: calc(var(--u) * 1.2) calc(var(--u) * 2.2) calc(var(--u) * 3.6) var(--desk-shadow);
}

.cover.is-inside > * {
    visibility: hidden;
}

/* a page that flips: ruled paper, turning on its left edge (the middle of the notebook).
   the shadow inside its left edge is the fold in the middle: a turned page shows it on its right edge,
   so the open notebook has the fold on both sides of the middle */
.opening-page {
    position: absolute;
    box-sizing: border-box;
    background-color: var(--paper);
    background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 13px, var(--rule) 13px, var(--rule) 14px);
    border: 1px solid var(--paper-edge);
    border-radius: 2px 6px 6px 2px;
    box-shadow: inset 12px 0 10px -10px rgba(45, 51, 64, 0.28), 1px 2px 4px rgba(45, 51, 64, 0.18);
    transform-origin: left center;
}

/* ---------- the height boxes (背の順: put away for now). the entrance, sitting down, and after sitting ---------- */

/* the height: a short box, then "cm" */
.height-field {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    flex-shrink: 0;
}

.height-input {
    width: 4.6em;
    text-align: right;
}

.height-unit {
    font-size: 13px;
    color: var(--ink-soft);
}

/* a height that is not a number from 50 to 250: written with the red pen */
.height-input.is-wrong {
    border-color: var(--red);
    color: var(--red);
}

/* streamer mode: the room code and the box to type it are blurred, so viewers cannot read them
   (on the entrance the pencil board also slides over the box. game.js keeps the code out of the page address too) */
.is-streamer .room-code,
.is-streamer .room-input {
    filter: blur(8px);
}

/* the streamer button on the blackboard of the lobby: the yellow marker while it is on */
.is-streamer .lobby-screen .streamer-button {
    color: var(--ink);
    background: var(--marker-yellow);
}

/* ---------- the entrance on a tall screen at least 900px wide (a tablet held upright) ----------
   side by side, the desk would be a thin band in the middle of the screen (1024x1366: u was 2.9px).
   so the notebook and the notes go on top, and the timetable under them (like design C on a middle screen).
   u: 2 rows = 2 papers (141.4u each) + the gap (8u) + the padding (6u) = 296.8u tall /
   the notebook and the notes side by side = 230u wide */
@media (min-width: 900px) and (max-aspect-ratio: 4/5) {
    .entrance-screen {
        --u: min(calc((100dvh - 62px) / 296.8), calc((100vw - 52px) / 230), 5.4px);
    }

    .mat-layout {
        grid-template-columns: auto auto;
        grid-template-areas:
            "cover notes"
            "timetable timetable";
        row-gap: calc(var(--u) * 8);
    }

    .cover-spot {
        grid-area: cover;
    }

    .note-area {
        grid-area: notes;
    }

    .timetable-spot {
        grid-area: timetable;
        justify-self: center;
    }

    /* the notebook is at the left edge of the desk here: the eraser lies more to the right, on its spine */
    .desk-eraser {
        left: calc(var(--u) * -5);
    }
}

/* ---------- the entrance on a phone (899px wide or less): one column, and the desk scrolls ----------
   first screen: the pencil case, the notebook (with the Name line) and the 部屋を作る pad.
   the timetable comes after the buttons.
   a screen less than 500px tall gets this column too (a big phone held sideways is 900px wide or more, but
   side by side the desk would be tiny and still scroll: at 932x370 u was 2.1px and the desk 516px tall) */
@media (max-width: 899px), (max-height: 499px) {
    .entrance-screen {
        /* the column is 104u wide (not wider than 4.6px * 104 on a tablet) */
        --u: min(calc((100vw - 50px) / 104), 4.6px);
    }

    .desk-mat {
        margin: 10px;
        border-radius: 20px;
    }

    /* (min-width: 0 = the column may be narrower than its widest content, so on a computer window this narrow,
       whose scrollbar takes about 15px, the papers become a little narrower instead of going under the edge
       of the desk, which cuts them off) */
    .mat-layout {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        min-width: 0;
        gap: calc(var(--u) * 4);
        padding: 12px;
    }

    /* display: contents = the box of .note-area goes away, and its children join the column,
       so the timetable can come between them (order) */
    .note-area {
        display: contents;
    }

    .pencil-case-spot {
        order: 1;
        width: min(100%, calc(var(--u) * 104));
        height: calc(var(--u) * 22);
    }

    .pencil-case {
        left: 0;
        width: calc(var(--u) * 60);
        height: calc(var(--u) * 22.2);
    }

    /* the place of the notebook takes its turn in the column, and the notebook fills it
       (align-self: auto = in the middle of the column, like the others. the computer stretches them) */
    .cover-spot {
        order: 2;
        align-self: auto;
        width: min(100%, calc(var(--u) * 104));
    }

    .cover {
        width: 100%;
        min-height: calc(var(--u) * 108);
    }

    .note-cluster {
        order: 3;
        width: min(100%, calc(var(--u) * 104));
        grid-template-rows: auto;
        grid-template-areas:
            "pad pad"
            "join join"
            "solo streamer";
    }

    .entrance-screen .room-pad {
        min-height: calc(var(--u) * 26);
    }

    .entrance-screen .solo-note,
    .entrance-screen .streamer-note {
        min-height: calc(var(--u) * 19);
    }

    .entrance-screen .join-note {
        min-height: calc(var(--u) * 22);
    }

    .entrance-note {
        order: 5;
        width: min(100%, calc(var(--u) * 104));
    }

    .timetable-spot {
        order: 6;
        align-self: auto;
        width: min(100%, calc(var(--u) * 104));
    }

    .timetable {
        width: 100%;
        min-height: 0;
        padding: calc(var(--u) * 5.4) calc(var(--u) * 5.4) calc(var(--u) * 5);
    }

    .timetable-rows {
        grid-auto-rows: auto;
    }

    .lesson {
        padding: calc(var(--u) * 2) calc(var(--u) * 3.4);
    }

    /* the letters of the timetable a little bigger (the same ratio as design B on a phone) */
    .lesson-name {
        font-size: max(14px, calc(var(--u) * 4.8));
    }

    .lesson-text,
    .note-line dd {
        font-size: max(12px, calc(var(--u) * 3.9));
    }

    .period-word,
    .note-line dt {
        font-size: max(11px, calc(var(--u) * 3.4));
    }

    /* no room around the timetable and the notebook on a phone */
    .desk-pencil,
    .desk-eraser,
    .desk-red-pen {
        display: none;
    }

    .desk-tools {
        order: 7;
        width: min(100%, calc(var(--u) * 104));
        padding: calc(var(--u) * 1) 0 calc(var(--u) * 3) calc(var(--u) * 2);
    }

    /* (the case is 60u wide here: the corners of the books are under its top right, a little smaller) */
    .book-stack {
        left: calc(var(--u) * 45);
        top: calc(var(--u) * -17);
        width: calc(var(--u) * 30);
        height: calc(var(--u) * 25.5);
    }
}

/* a phone or a tablet held upright (2026-10-18 pineさん "ノートが正方形なのが違和感／筆箱や教科書を消去して上の空いた
   スペースをノートで伸ばして長方形にしたい"): no pencil case and books (the books are inside the case), and the notebook
   takes their place: 134u = its 108u, the case's 22u and the 4u between them, so every button stays where it was.
   (not a phone held sideways: the notebook would be too tall for its short screen) */
@media (max-width: 899px) and (min-height: 500px) {
    /* (the size also follows the height: an upright tablet, whose page index.html makes 540×720, gets the same
       composition as a 390×760 phone: 760 × 0.0043 = (390 − 50) / 104. a phone at least that tall is unchanged) */
    .entrance-screen {
        --u: min(calc((100vw - 50px) / 104), calc(100dvh * 0.0043), 4.6px);
    }

    .entrance-screen .pencil-case-spot {
        display: none;
    }

    .entrance-screen .cover {
        min-height: calc(var(--u) * 134);
    }
}

/* people who asked for less movement: no slow moves and no flash */
@media (prefers-reduced-motion: reduce) {
    .pencil-board,
    .board-print,
    .entrance-screen button.sticky-note,
    .entrance-screen .join-button {
        transition-duration: 0.01s;
        transition-delay: 0s;
    }

    .is-streamer .pencil-board::after {
        animation: none;
    }

    .is-streamer .board-print {
        transition-delay: 0s;
    }
}

/* ---------- lobby: the blackboard ---------- */

.board-title {
    font-size: 18px;
}

/* the room code: written with yellow chalk */
.room-row {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    color: var(--chalk-yellow);
}

.room-label {
    font-size: 12px;
}

.room-code {
    font-size: 17px;
    letter-spacing: 3px;
}

/* the host (学級委員): a red armband, then the name */
.host-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}

.host-badge {
    font-family: var(--hand);
    font-weight: 600;
    font-size: 11px;
    color: var(--white);
    background: #c0392b;
    padding: 1px 8px;
    border-radius: 2px;
    letter-spacing: 0.1em;
    flex-shrink: 0;
}

.host-note {
    font-size: 12px;
    color: var(--chalk-blue);
}

.host-note:empty {
    display: none;
}

/* a notice about a change of the terms (2026-10-23, notice.js), in yellow chalk under the host */
.board-notice {
    font-size: 12px;
    line-height: 1.5;
    color: var(--chalk-yellow);
}

.board-notice a {
    color: var(--chalk);
}

/* (the red pen does not show on the blackboard: pink chalk) */
.board-notice .terms-notice-head {
    color: var(--chalk-pink);
}

/* the rules of the next game, for everyone but the host: two columns of "label value" */
.rule-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 12px;
    font-size: 14px;
}

.rule-summary div {
    display: flex;
    gap: 8px;
}

.rule-summary dt {
    color: var(--chalk-blue);
    flex-shrink: 0;
}

.rule-summary:empty,
.lobby-screen.is-host .rule-summary {
    display: none;
}

.room-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* "部屋を出る": at the right end, away from the other two, so it is not pressed by mistake */
.room-buttons .leave-room-button {
    margin-left: auto;
}

/* ---------- lobby: the page (the settings, the attendance book, start) ---------- */

.lobby-paper {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 12px;
}

/* the settings: on a phone, only the host sees them (on a computer, everyone: see the wide screen part) */
.lobby-settings {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lobby-screen:not(.is-host) .lobby-settings {
    display: none;
}

/* not the host: the triangles cannot be pressed, so they are not shown (only the choice now).
   (visibility: hidden keeps their place, so the choice stays in the middle) */
.lobby-screen:not(.is-host) .lobby-settings .triangle-button {
    visibility: hidden;
}

/* not the host: the list of ways for "1つだけ" is only to read, not grayed out like "cannot be chosen now" */
.lobby-screen:not(.is-host) .lobby-settings select:disabled {
    opacity: 1;
    color: var(--ink);
}

/* the title of the rules (and, on a phone's rules screen, "クラスにもどる" for the host).
   a phone's class screen does not show the rules: see the part for a phone */
.settings-head {
    display: none;
    align-items: center;
    gap: 8px;
}

/* (a dark yellow brown: easy to read on the paper and on the yellow sticky note) */
.settings-title {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    color: #6b5d16;
}

/* クラスにもどる: only for the host, only on the rules screen (on a computer too: a computer host may take over
   from a phone host, and the people waiting on phones must be able to go back to the class) */
.class-back-button {
    display: none;
    padding: 2px 10px;
    font-size: 12px;
}

.lobby-screen.is-rules-stage.is-host .class-back-button {
    display: inline-block;
}

/* only for screen readers: not on the screen */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* a setting of the next game: a label, then an arrow picker.
   (padding-top: room for the 2 rings above the card. the label and the triangles stay in the middle of the card) */
.setting-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 6px;
}

.setting-label {
    font-size: 12px;
    width: 5.6em;
    flex-shrink: 0;
    color: #4a5160;
}

/* a short help line under a setting, starting under its card (12px label × 5.6em + the gap) */
.setting-hint {
    margin: 0 0 0 calc(12px * 5.6 + 6px);
    font-size: 12px;
    line-height: 1.5;
    color: var(--ink-soft);
}

/* an arrow picker (◀ the choice now ▶), drawn as a flip scoreboard of a sports day (めくり式の得点板):
   the choice is written on a white card hung by two rings, with the fold line across the middle.
   ◀ ▶ flip to the card before / after (2026-10-09 pineさん chose it from 4 school things) */
.setting-box {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 2px;
}

/* the chosen tab: painted with the yellow marker */
.tab-box button.is-chosen {
    background: var(--marker-yellow);
    border-color: var(--yellow-edge);
}

/* the triangles: no box of their own, only the blue triangle (the place to press is bigger than the triangle) */
.triangle-button {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    padding: 6px 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.triangle-button:active {
    box-shadow: none;
}

.triangle-icon {
    width: 16px;
    height: 16px;
    fill: var(--blue-pen);
}

/* the card: white, a thin fold line across the middle, and room above it for the 2 rings */
.picker-name {
    position: relative;
    flex: 1;
    min-width: 0;
    text-align: center;
    font-size: 13px;
    white-space: nowrap;
    padding: 4px 4px 3px;
    background:
        linear-gradient(to bottom, transparent calc(50% - 0.5px), #c9ccd4 calc(50% - 0.5px), #c9ccd4 calc(50% + 0.5px), transparent calc(50% + 0.5px)),
        var(--white);
    border: 1.5px solid var(--ink);
    border-radius: 3px;
    box-shadow: 0 2px 0 rgba(45, 51, 64, 0.18);
    /* the card flips down from its top, where the rings are */
    transform-origin: top center;
}

/* a card that can be changed: pressing it goes to the next choice (game.js makeArrowPicker) */
.setting-box:has(> .triangle-button:not(:disabled)) .picker-name {
    cursor: pointer;
}

/* the 2 rings the card hangs from */
.picker-name::before,
.picker-name::after {
    content: "";
    position: absolute;
    top: -8px;
    width: 6px;
    height: 11px;
    border: 2px solid #8a8f9c;
    border-radius: 4px;
}

.picker-name::before {
    left: 26%;
}

.picker-name::after {
    right: 26%;
}

/* the choice changed: the new card flips down over the old one (game.js puts is-flipping) */
.picker-name.is-flipping {
    animation: card-flip 0.35s ease-out;
}

@keyframes card-flip {
    0% {
        transform: perspective(240px) rotateX(-75deg);
        opacity: 0.4;
    }
    100% {
        transform: perspective(240px) rotateX(0deg);
        opacity: 1;
    }
}

/* the preview of the mode: a white frame under the mode (which ways it gives). it takes all the room left
   under the rules (flex: 1 0 auto: it grows, and never gets shorter than what is in it. 2026-10-09 pineさん
   "一覧の枠を決まりを決めるの下を埋めるくらい大きく").
   the 4 panels are piled up in the same cell of a grid (grid-area: 1 / 1), so the cell is as tall as the tallest
   panel: the frame never changes its height when the mode changes. only the panel of the mode now can be seen */
.mode-preview {
    position: relative;
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
    /* room at the top for the slip held by the clip (half of the slip is above the frame) */
    padding: 20px 10px 8px;
    background: var(--white);
    border: 1.5px solid var(--ink);
    border-radius: 3px;
    box-shadow: 0 2px 0 rgba(45, 51, 64, 0.18);
}

/* "伝え方一覧": a paper slip held at the top left of the frame by a clip (the clip is drawn with one line) */
.method-list-button {
    position: absolute;
    top: -9px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px 12px 3px 8px;
    font-size: 13px;
    background: var(--sticky-blue);
    border: 1px solid var(--gray-edge);
    border-radius: 2px;
    box-shadow: 1px 2px 0 var(--shadow);
}

.clip-icon {
    width: 12px;
    height: 28px;
    margin: -14px 2px -4px 0;
    fill: none;
    stroke: #7b8494;
    stroke-width: 1.6;
    stroke-linecap: round;
}

/* (a small warning: the dark red, like the letters that cannot be used) */
.mode-preview-note {
    font-size: 12px;
    color: var(--red-dark);
}

.mode-panels {
    display: grid;
}

/* (visibility: hidden keeps the size of a panel that is not shown, and it cannot be pressed or read) */
.mode-panel {
    grid-area: 1 / 1;
    min-width: 0;
    visibility: hidden;
}

.mode-panel.is-shown {
    visibility: visible;
}

/* the ways of a mode: one row for each group (声・絵・文字・記号), with the name of the group at its head
   (2026-10-09 pineさん "ただ並べるだけじゃなくて、行を分けるとか、くくりをつけるとか") */
.mode-chips {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chip-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

/* the name of the group: a tag in the blue of the headings */
.chip-row-label {
    flex-shrink: 0;
    width: 3em;
    font-size: 13px;
    line-height: 24px;
    text-align: center;
    color: var(--blue-pen-dark);
    background: var(--marker-blue);
    border-radius: 3px;
}

/* the chips of the row (the picture and the name. the rule is shown under the mouse) */
.chip-row-chips {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

/* a chip is a small button: it opens the way list at its way (game.js makeModeChips, 2026-10-16 UI-18).
   (the same size as before it was a button: no shadow of its own, so the frame of the preview stays as tall) */
.mode-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 8px 0 6px;
    font-size: 14px;
    line-height: 22px;
    white-space: nowrap;
    background: var(--paper);
    border: 1px solid var(--gray-edge);
    border-radius: var(--sketch-small);
    box-shadow: none;
}

.mode-chip:hover {
    border-color: var(--blue-pen);
}

.mode-chip:active {
    box-shadow: none;
}

.mode-chip .line-icon {
    width: 16px;
    height: 16px;
}

/* 1つだけ: the list of the ways, and the rule of the way chosen */
.single-panel {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.method-select {
    font-size: 16px;
    font-size: max(16px, calc(16.5px / var(--page-scale, 1)));
    padding: 3px 8px;
    border-width: 1.5px;
    border-color: var(--gray-edge);
}

.single-rule {
    font-size: 12px;
    line-height: 1.5;
    color: #4a5160;
}

.single-rule .line-icon {
    margin-right: 3px;
}

/* the buttons only for the host: pass the host's place to someone */
.host-box {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.host-box:empty {
    display: none;
}

.host-box select {
    flex: 1;
    width: auto;
    min-width: 0;
    font-size: 16px;
    font-size: max(16px, calc(16.5px / var(--page-scale, 1)));
    padding: 4px 8px;
    border-width: 1.5px;
    border-color: var(--gray-edge);
}

.lobby-work {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* the heading of the attendance book: underlined with the blue marker. the note at the right end */
.roll-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.roll-head .roll-note {
    margin-left: auto;
}

.roll-title {
    font-size: 16px;
    border-bottom: 3px solid var(--marker-blue);
}

.roll-note {
    font-size: 12px;
    color: var(--ink-soft);
    text-align: right;
}

/* the attendance book (出席簿): a ruled list. each line: the attendance number in its own column, then the nickname.
   4 lines make a column: from the 5th person, a second column starts on the right (1〜4 | 5〜8) */
.roll-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-rows: repeat(4, auto);
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    column-gap: 14px;
    align-content: start;
    /* its own lines only: the lines of the page behind would not meet them */
    background: var(--paper);
}

/* (flex-wrap: when the name, the armband and 外す do not fit in a narrow column, the armband and 外す go to the next line) */
.roll-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 8px;
    min-height: 30px;
    padding: 2px 4px 2px 0;
    box-sizing: border-box;
    border-bottom: 1px solid var(--rule);
    font-size: 15px;
}

/* the first line of each column: a darker line above it, like the top of a printed list */
.roll-line:nth-child(4n + 1) {
    border-top: 1.5px solid var(--gray-edge);
}

.roll-number {
    flex-shrink: 0;
    width: 1.8em;
    text-align: center;
    font-size: 12px;
    color: var(--ink-soft);
    border-right: 1px solid var(--rule);
}

/* the nickname takes the rest of the line. (flex: 1 1 5em = it starts from 5 letters wide, so it stays on
   the line of its number; only the armband and 外す go to the next line when the column is narrow) */
.roll-name {
    flex: 1 1 5em;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* a nickname is never folded (the evening of 2026-10-16: "あおやまりん／たろ" at 320px with 8 people; folding it between
   phrases made it "あ／おやまりんた／ろ"). in a narrow column it gets smaller, so its 8 letters fit in one line:
   100cqi = the width of the line (container-type), less the attendance number and the gap (36px) */
.roll-line {
    container-type: inline-size;
}

.roll-name-text {
    white-space: nowrap;
    font-size: min(1em, calc((100cqi - 36px) / 8));
}

/* my own line: my name has the yellow marker (only under the letters) */
.roll-line.is-mine .roll-name-text {
    background: linear-gradient(transparent 50%, var(--marker-yellow) 50%);
}

/* the armband and 外す: at the right end (also when they go to the next line) */
.roll-tags {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.roll-me {
    font-size: 0.75em;
    white-space: nowrap;
}

.roll-line .host-badge {
    font-size: 10px;
    padding: 0 6px;
}

.roll-empty {
    font-size: 13px;
    color: var(--ink-soft);
    padding: 6px 0;
}

/* send someone out of a seat (only the host): written with the red pen */
.kick-button {
    font-size: 11px;
    color: var(--red);
    background: transparent;
    border: 1px solid var(--red);
    border-radius: 3px;
    padding: 1px 6px;
    box-shadow: none;
}

/* sit down with a nickname (and a height, if you like) */
.sit-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sit-row .name-input {
    flex: 1;
    min-width: 0;
}

/* (2026-10-21) 規約に同意して / 席に着く in 2 short lines: the button keeps the height of the others (44px) and stays
   narrow, so the box for the nickname keeps its room on a phone (in one line, it was 112px wide at 320px and its
   hint was cut) */
.sit-button {
    min-height: 44px;
    padding: 4px 12px;
    font-size: 13px;
    line-height: 1.2;
}

/* my height after sitting (only in a room lined up by height) */
.my-height-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    font-size: 13px;
}

.my-height-note {
    font-size: 11px;
    color: var(--ink-soft);
}

/* in the lobby, the height box is as tall as the other small parts (16px or more: an iPhone does not zoom in) */
.lobby-work .height-input {
    font-size: 16px;
    font-size: max(16px, calc(16.5px / var(--page-scale, 1)));
    padding: 4px 8px;
}

.lobby-message {
    font-size: 13px;
    text-align: center;
    color: #4a5160;
}

/* ---------- how to play, under the class (a phone): a small copy of the timetable of the entrance ----------
   2026-10-16 UI-22. game.js makeClassTimetable copies the heading and the 5 rows of the entrance into this box, and
   the rules of the entrance draw them (they are counted in u: here u is small and fixed). only what is different is
   written here: each lesson is one flow of words (its name, then what to do), and "1時間目" is one line, so a row
   takes 1 or 2 lines. it is a part of its own (this box, these rules and makeClassTimetable), so it can go to
   another place of the room as it is. a computer shows it too, when it fits (fitClassTimetable) */
.class-timetable {
    --u: 2.6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

/* the heading: smaller, at the left */
.class-timetable .timetable-title {
    justify-content: flex-start;
    margin: 0;
}

.class-timetable .timetable-title-main {
    font-size: 17px;
}

.class-timetable .timetable-clock {
    display: none;
}

/* the table: white (the lines of the page do not show through it), each row as tall as its own words */
.class-timetable .timetable-rows {
    flex: none;
    grid-auto-rows: auto;
    background: var(--white);
}

.class-timetable .period-row {
    grid-template-columns: 4.6em minmax(0, 1fr);
}

/* "1時間目" on one line, in the middle of its cell (flex-wrap: wrap lets align-content center the line) */
.class-timetable .period {
    flex-direction: row;
    flex-wrap: wrap;
    align-content: center;
    align-items: baseline;
    gap: 1px;
    padding: 4px 2px;
    font-size: 13px;
}

.class-timetable .period-number {
    font-size: 16px;
}

.class-timetable .period-word,
.class-timetable .period-word.is-word-only {
    font-size: 11px;
}

/* the name of the lesson, then what to do, in one flow of words */
.class-timetable .lesson {
    display: block;
    padding: 4px 8px;
}

.class-timetable .lesson-name {
    margin-right: 6px;
    font-size: 13px;
}

.class-timetable .lesson-text {
    font-size: 12px;
}

/* a computer: at the bottom of the page of the class, in the room left under the attendance book (2026-10-17 pineさん
   q-timetable-pc). game.js fitClassTimetable hides it when the page would scroll (8 people, a short screen) */
@media (min-width: 900px) {
    .class-timetable {
        margin-top: auto;
        padding-top: 8px;
    }
}

/* start: on a phone, it stays at the bottom of the page even when the page scrolls
   (8 people in a room do not fit on a small phone, and the host must always find this button).
   (it is a child of .lobby-paper itself, so it can stick to the bottom of the whole page) */
.start-button {
    position: sticky;
    bottom: 0;
    z-index: 1;
    /* (with few people, it still sits at the bottom of the page, not in the middle) */
    margin-top: auto;
    font-size: 18px;
}

/* ---------- play: the blackboard ---------- */

.play-board .board-head {
    /* room for the sticky note at the top right (終わらせる is the longest).
       a long name moves the mode to the next line, so it never goes under the note */
    flex-wrap: wrap;
    padding-right: 82px;
}

.round-title {
    font-size: 14px;
    white-space: nowrap;
}

.mode-tag {
    font-size: 12px;
    color: var(--chalk-blue);
    white-space: nowrap;
}

/* the step before, the step now (circled with yellow chalk), and the step after */
.step-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.step-strip span {
    opacity: 0.55;
}

.step-strip .is-now {
    opacity: 1;
    font-size: 15px;
    color: var(--chalk-yellow);
    border: 2px solid var(--chalk-yellow);
    border-radius: 50%;
    padding: 0 10px;
}

/* what to do now: small blue chalk (round 0: big, because nothing came yet) */
.role-title {
    font-size: var(--text-note);
    color: var(--chalk-blue);
}

.role-name::after {
    content: "：";
}

.play-board.is-start .role-name {
    display: block;
    font-size: 26px;
    color: var(--chalk);
}

.play-board.is-start .role-name::after {
    content: none;
}

/* what came to me: written big on the board, in a frame drawn with yellow chalk,
   with "あなたに届いたお題" on top (so it is clear what to send, even right after the screen changed) */
.received-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    border: 2px dashed rgba(245, 226, 122, 0.75);
    border-radius: var(--sketch-small);
    padding: 4px 10px 6px;
}

.received-label {
    font-size: 13px;
    color: var(--chalk-yellow);
}

/* a new round: the frame flashes once (game.js puts is-new when the round changes) */
.received-box.is-new {
    animation: received-flash 1.4s ease-out;
}

@keyframes received-flash-still {
    0% {
        background: rgba(245, 226, 122, 0.35);
        border-color: var(--chalk-yellow);
    }
    100% {
        background: transparent;
    }
}

@keyframes received-flash {
    0% {
        background: rgba(245, 226, 122, 0.35);
        border-color: var(--chalk-yellow);
        transform: scale(0.96);
    }
    35% {
        transform: scale(1);
    }
    100% {
        background: transparent;
    }
}

.received-message {
    font-size: 30px;
    line-height: 1.25;
    letter-spacing: 0.04em;
    border-bottom: 2px dashed rgba(243, 240, 230, 0.5);
    padding-bottom: 2px;
}

/* a short word is written bigger, a long message smaller (game.js chooses) */
.received-message.is-short-text {
    font-size: 36px;
}

.received-message.is-long-text {
    font-size: 19px;
}

/* a picture that was sent: a white sheet stuck on the board (tap it to see it big).
   its place (received-stage) is as wide as the frame; in a guess round it also takes the height (below) */
.received-stage {
    align-self: stretch;
    display: flex;
}

.received-canvas {
    display: block;
    width: min(100%, 22dvh);
    aspect-ratio: 1;
    background: var(--white);
    cursor: zoom-in;
}

/* a guess round where a drawing came (game.js is-guessing-picture, 2026-10-16 UI-2: it was 167px on a 390×760 phone,
   with a lot of empty page under the box): the drawing is the main thing. the page only takes what it needs (the box
   and 送る right under the drawing), the blackboard takes the rest, and the drawing is as big as its place allows,
   in the middle (container-type: size gives the canvas cqw / cqh = 1% of its place's width / height).
   (min-height: on a very short screen the drawing keeps this size, and the screen scrolls.
   a computer: see the wide screen part) */
@media (max-width: 899px) {
    .play-screen.is-guessing-picture > .board-frame,
    .play-screen.is-guessing-picture .play-board,
    .play-screen.is-guessing-picture .received-box {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
    }

    .play-screen.is-guessing-picture .play-work {
        flex: 0 0 auto;
    }
}

.play-screen.is-guessing-picture .received-stage {
    flex: 1 1 0;
    min-height: 140px;
    container-type: size;
    justify-content: center;
    align-items: center;
}

.play-screen.is-guessing-picture .received-canvas {
    width: min(100cqw, 100cqh);
}

.received-canvas:focus-visible {
    outline: 3px solid var(--chalk-yellow);
    outline-offset: 2px;
}

/* the picture made big: over the whole screen, on a dark sheet. tap anywhere to close */
/* the words that come on a sticky note at the start of a round (game.js playStickyArrive, about 2 seconds).
   over everything. a tap on it skips it (game.js skipStickyArrive): a tap that went through chose the card under it.
   the clock goes on */
.arrive-layer {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
}

.arrive-dim {
    position: absolute;
    inset: 0;
    background: var(--dim);
}

.arrive-sticky {
    position: relative;
    width: min(84vw, 420px);
    box-sizing: border-box;
    padding: 18px 20px 22px;
    background: linear-gradient(180deg, var(--sticky-yellow-top) 0, var(--sticky-yellow) 22px, var(--sticky-yellow) 100%);
    box-shadow: 0 3px 4px var(--shadow);
    rotate: -2deg;
    text-align: center;
}

/* the curled corner at the bottom right */
.arrive-sticky::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, transparent 50%, var(--shadow) 50%, transparent 100%);
}

.arrive-label {
    font-size: 14px;
    line-height: 1.4;
    color: var(--sticky-yellow-ink);
    text-align: left;
    margin-bottom: 4px;
}

/* the words, written in pen: one box for each letter (they come one by one); the words between spaces never break */
.arrive-text {
    font-size: 32px;
    line-height: 1.3;
    letter-spacing: 0.04em;
    color: var(--ink);
}

.arrive-text.is-long {
    font-size: 24px;
}

.arrive-text.is-very-long {
    font-size: 19px;
}

.pen-part {
    white-space: nowrap;
}

.pen-char {
    display: inline-block;
    rotate: var(--tilt, 0deg);
}

@media (min-width: 900px) {
    .arrive-sticky {
        width: 480px;
        padding: 22px 26px 26px;
    }

    .arrive-label {
        font-size: 16px;
    }

    .arrive-text {
        font-size: 42px;
    }

    .arrive-text.is-long {
        font-size: 30px;
    }

    .arrive-text.is-very-long {
        font-size: 23px;
    }
}

.zoom-box {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(45, 51, 64, 0.88);
    cursor: zoom-out;
}

.zoom-canvas {
    width: min(92vw, 80dvh);
    aspect-ratio: 1;
    background: var(--white);
}

.zoom-note {
    font-size: 13px;
    color: var(--white);
}

/* ---------- a question or a message on the page (dialog.js): a card of paper over the dimmed page ----------
   (2026-10-19: the browser's own confirm / alert / prompt do not show in the Google app on iPhone. a <dialog> opened
   with showModal: the browser keeps it above everything, and the page behind it cannot be pressed or reached) */
.page-dialog {
    width: min(100% - 32px, 400px);
    max-height: calc(100% - 32px);
    box-sizing: border-box;
    overflow-y: auto;
    margin: auto;
    padding: 20px 18px 16px;
    color: var(--ink);
    /* (the same paper as the sheets of お題一覧・伝え方一覧) */
    background: var(--paper);
    border: none;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.page-dialog::backdrop {
    background: rgba(45, 51, 64, 0.6);
}

/* (a line break in a message starts a new line. long words break where Japanese may break, never before "ー" or "。") */
.page-dialog-message {
    margin: 0;
    font-size: 16px;
    line-height: 1.7;
    white-space: pre-line;
    word-break: normal;
    word-break: auto-phrase;
    line-break: strict;
    overflow-wrap: anywhere;
}

.page-dialog-words {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 12px;
    padding: 8px 12px;
    font-family: inherit;
    font-weight: 600;
    /* (16px or more on the screen, or iPhone zooms in when it is pressed: the same as the other boxes) */
    font-size: max(17px, calc(16.5px / var(--page-scale, 1)));
    color: var(--ink);
    background: var(--white);
    border: 2px solid var(--ink);
    border-radius: var(--sketch-small);
    resize: vertical;
}

/* the buttons at the bottom right: キャンセル, then the one that does it. as big as a finger: 44px on the screen, also where
   the page is drawn smaller (a 320px phone at 0.85, a sideways tablet at 0.83. 2026-10-19 review: they were 36-37px) */
.page-dialog-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px 12px;
    margin-top: 16px;
}

.page-dialog-buttons button {
    min-height: calc(44px / var(--page-scale, 1));
}

/* ---------- 設定 (2026-10-20 pineさん): the voice chat and the volume of the sound effects, on a small sheet ---------- */
/* (with the box in front: .sheet-paper comes later in this file and would win, 940px wide. 2026-10-20 review) */
.options-box .options-paper {
    width: min(100%, 460px);
    gap: 14px;
}

.options-part {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.options-heading {
    margin: 0;
    font-size: 16px;
    border-bottom: 2px solid var(--marker-blue);
    align-self: flex-start;
}

.chat-state {
    margin: 0;
    font-size: 15px;
}

/* why I cannot join, in the red pen (the address in it breaks anywhere: it is long, with no spaces) */
.chat-problem {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--red);
    overflow-wrap: anywhere;
    user-select: text;
    -webkit-user-select: text;
}

/* who is in the chat: one line each, the name and how the talk is */
.chat-people {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
}

.chat-people:empty {
    display: none;
}

.chat-people .is-trouble {
    color: var(--red);
}

.chat-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
}

/* as big as a finger on the screen, also where the page is drawn smaller (the same as the questions: dialog.js) */
.chat-buttons button,
.volume-choices button {
    min-height: calc(44px / var(--page-scale, 1));
}

/* 小・中・大・切 in a row: the one chosen now has the yellow marker */
.volume-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.volume-choices button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: calc(64px / var(--page-scale, 1));
    justify-content: center;
}

.volume-choices button[aria-pressed="true"] {
    background: linear-gradient(transparent 50%, var(--marker-yellow) 50%), var(--white);
}

/* ---------- 意見箱 (2026-10-23, inbox.js): a note to the operator, and the replies by receipt number ---------- */
/* (the same small sheet as 設定. with the box in front, for the same reason as .options-paper) */
.inbox-box .inbox-paper {
    width: min(100%, 520px);
    gap: 14px;
}

.inbox-closed-note,
.inbox-lead {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
}

.inbox-closed-note a,
.inbox-paper .sheet-note a {
    color: var(--blue-pen);
}

/* "do not write how to reach you": in the red pen, so it is read before writing */
.inbox-warning {
    margin: 0;
    font-size: 14px;
    color: var(--red);
}

/* the box to write in: the same as the box of the questions (16px or more on the screen, or iPhone zooms in) */
.inbox-text {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    font-family: inherit;
    font-weight: 600;
    font-size: max(17px, calc(16.5px / var(--page-scale, 1)));
    line-height: 1.6;
    color: var(--ink);
    background: var(--white);
    border: 2px solid var(--ink);
    border-radius: var(--sketch-small);
    resize: vertical;
}

.inbox-count {
    margin: -4px 0 0;
    align-self: flex-end;
    font-size: 12px;
    color: var(--ink-soft);
}

.inbox-count.is-over,
.inbox-message {
    color: var(--red);
}

.inbox-message {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

.inbox-message:empty {
    display: none;
}

/* a receipt number is written in letters of one width: in the hand font, q and 9 or z and 2 look alike */
.inbox-sent-number,
.inbox-item-number,
.inbox-key-input {
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
}

/* the receipt number: big, with room between the letters, and it can be selected to copy */
.inbox-sent-number {
    margin: 0;
    font-size: 26px;
    letter-spacing: 0.08em;
    user-select: all;
    -webkit-user-select: all;
}

.inbox-sent-note {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

/* the numbers sent from this browser: one each, under a dashed line */
.inbox-list {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
}

.inbox-list li {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--rule);
}

.inbox-empty {
    font-size: 14px;
    color: var(--ink-soft);
}

.inbox-item-number {
    margin: 0;
    font-size: 18px;
    letter-spacing: 0.06em;
}

.inbox-item-about {
    margin: 0;
    font-size: 12px;
    color: var(--ink-soft);
    overflow-wrap: anywhere;
}

.inbox-item-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
}

/* as big as a finger on the screen (the same as the buttons of 設定) */
.inbox-item-buttons button,
.inbox-look-button {
    min-height: calc(44px / var(--page-scale, 1));
}

.inbox-key-label {
    font-size: 14px;
}

.inbox-key-row {
    display: flex;
    gap: 8px;
}

.inbox-key-input {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    font-weight: 600;
    font-size: max(17px, calc(16.5px / var(--page-scale, 1)));
    color: var(--ink);
    background: var(--white);
    border: 2px solid var(--ink);
    border-radius: var(--sketch-small);
}

/* what came back: "まだ…", or the reply on a light blue card (what pine wrote keeps its lines) */
.inbox-answer {
    font-size: 14px;
    line-height: 1.6;
}

.inbox-answer:empty {
    display: none;
}

.inbox-answer.has-reply {
    padding: 8px 12px;
    background: var(--sticky-blue);
    border-left: 4px solid var(--blue-pen);
    border-radius: 2px;
}

.inbox-answer-head {
    margin: 0;
    font-size: 12px;
    color: var(--blue-pen-dark);
}

.inbox-answer-words {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    user-select: text;
    -webkit-user-select: text;
}

/* ---------- the sheets laid over the page (お題一覧・伝え方一覧): a printed sheet ---------- */

.sheet-box {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(45, 51, 64, 0.6);
}

/* the sheet: only the list inside it scrolls (the topic list has 238 items) */
.sheet-paper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(100%, 940px);
    max-height: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    /* an item reached with Tab is not hidden under the title line */
    scroll-padding-top: 90px;
    padding: 0 16px 16px;
    background: var(--paper);
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

/* the title line stays at the top while the list scrolls */
.sheet-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 14px 0 8px;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
}

/* the title on the left, the 2 buttons on the right, and the count on its own line under them */
.sheet-title {
    margin: 0 auto 0 0;
    font-size: 18px;
    border-bottom: 3px solid var(--marker-blue);
}

.sheet-count {
    order: 1;
    flex-basis: 100%;
    font-size: 13px;
    color: var(--ink-soft);
}

.sheet-close-button {
    padding: 5px 18px;
    font-size: 15px;
}

.sheet-note {
    font-size: 12px;
    color: var(--ink-soft);
}

.sheet-group-title {
    margin: 8px 0 0;
    font-size: 14px;
    color: var(--blue-pen-dark);
}

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

/* an item that comes out: a white card / one that does not: gray, with a dashed edge (and crossed out with the red pen) */
.sheet-chip {
    font-size: 13px;
    padding: 3px 10px;
    border-width: 1px;
    border-color: var(--gray-edge);
    border-radius: var(--sketch-small);
    box-shadow: none;
}

.sheet-chip.is-off {
    color: var(--ink-soft);
    background: #ece8dd;
    border-style: dashed;
}

.topic-chip.is-off {
    text-decoration: line-through;
    text-decoration-color: var(--red);
}

/* (not the host, or the last one: it cannot be pressed, but it is not grayed out) */
.sheet-chip:disabled {
    opacity: 1;
}

/* the way list: a card for each way, side by side as many as fit (the picture and the name, the rule under them) */
.method-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: 6px;
}

.method-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: left;
    padding: 5px 10px 6px;
}

.method-card-name {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
}

/* the mode the way comes out in: small, after the name */
.method-card-tier {
    margin-left: 4px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 400;
    color: var(--ink-soft);
    border: 1px solid var(--rule);
    border-radius: 3px;
}

/* (only the name is crossed out: the rule stays easy to read) */
.method-card.is-off .method-card-name {
    text-decoration: line-through;
    text-decoration-color: var(--red);
}

/* the way whose chip in the preview was pressed: it glows with the yellow marker for a moment (yellow = now).
   only its colors change (nothing moves), so it is the same for people who asked for less movement */
.method-card.is-pointed {
    animation: card-point 1.8s ease-out;
}

@keyframes card-point {
    0%,
    45% {
        background-color: var(--sticky-yellow);
        border-color: var(--yellow-edge);
        box-shadow: 0 0 0 4px var(--marker-yellow);
    }
    100% {
        box-shadow: 0 0 0 4px transparent;
    }
}

.method-card-rule {
    font-size: 11px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--ink-soft);
}

/* ---------- 伝え方一覧 on a computer: the whole screen, one column for each group (声・絵・文字・記号), and in a
   column the cards share its height equally (pineさん 2026-10-13 "伝え方一覧、枠いっぱいに一覧を均等に表示して").
   nothing scrolls: on a shorter screen the rule under each name gets fewer lines, and the whole rule is shown when
   the mouse is on the card (title, game.js makeMethodList). a phone keeps one card in a line, and scrolls.
   (grid-auto-flow: column = the headings and the card boxes are siblings, so they are put down the 2 rows of a
   column, heading then cards, then the next column) ---------- */
@media (min-width: 900px) {
    .method-list-box .sheet-paper {
        width: 100%;
        height: 100%;
    }

    .method-list-groups {
        flex: 1;
        min-height: 0;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        grid-auto-flow: column;
        grid-auto-columns: minmax(0, 1fr);
        column-gap: 10px;
    }

    .method-list-groups .method-cards {
        grid-template-columns: minmax(0, 1fr);
        grid-auto-rows: minmax(0, 1fr);
    }

    .method-list-groups .method-card {
        justify-content: center;
        min-height: 0;
        overflow: hidden;
    }

    /* (in a narrow column, the mode goes under a long name instead of out of the card) */
    .method-list-groups .method-card-name {
        flex-wrap: wrap;
        row-gap: 1px;
    }

    /* (-webkit-line-clamp: at most this many lines, then "…") */
    .method-list-groups .method-card-rule {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        overflow: hidden;
    }
}

/* the lower the screen, the shorter the cards: the rule gets fewer lines, then only the name is left
   (8 cards in the tallest column: 3 lines need about 900px, 2 lines 760px, 1 line 620px) */
@media (min-width: 900px) and (max-height: 899px) {
    .method-list-groups .method-card-rule {
        -webkit-line-clamp: 2;
    }
}

@media (min-width: 900px) and (max-height: 760px) {
    .method-list-groups .method-cards {
        gap: 4px;
    }

    .method-list-groups .method-card {
        padding: 2px 8px;
    }

    /* (a long name with its mode under it still fits in a short card) */
    .method-list-groups .method-card-name {
        line-height: 1.25;
    }

    .method-list-groups .method-card-rule {
        -webkit-line-clamp: 1;
    }
}

@media (min-width: 900px) and (max-height: 619px) {
    .method-list-groups .method-card-rule {
        display: none;
    }
}

/* a very low screen (a big phone held sideways): 8 names do not fit in the height (in a narrow column a long
   name takes 2 lines), so the columns keep their cards' own height, and the list scrolls under its title */
@media (min-width: 900px) and (max-width: 1239px) and (max-height: 559px), (min-width: 900px) and (max-height: 449px) {
    .method-list-groups {
        grid-template-rows: auto auto;
        overflow-y: auto;
    }

    .method-list-groups .method-cards {
        grid-auto-rows: auto;
    }

    .method-list-groups .method-card {
        overflow: visible;
    }
}

/* a touch screen 900px wide or more (a tablet held sideways): there is no mouse to show the whole rule (title), so
   every rule is shown whole, and the list scrolls under its title, like the very low screen above (2026-10-16 UI-25:
   バビ語・電報・逆再生ボイス… were cut with "…" and could not be read to the end) */
@media (min-width: 900px) and (hover: none) {
    .method-list-groups {
        grid-template-rows: auto auto;
        overflow-y: auto;
    }

    .method-list-groups .method-cards {
        grid-auto-rows: auto;
    }

    .method-list-groups .method-card {
        overflow: visible;
    }

    .method-list-groups .method-card-rule {
        display: block;
        -webkit-line-clamp: none;
        overflow: visible;
    }
}

/* the button on the sticky note that opens the list */
.topic-list-button {
    flex: 1;
    padding: 4px 8px;
}

/* "見る" next to "伝え方 出ない N個" on the board (a phone, everyone but the host) */
.summary-view-button {
    margin-left: 6px;
    padding: 0 8px;
    font-size: 11px;
}

/* やめる / 終わらせる: a pink sticky note with red letters, the same look everywhere (2026-10-16 UI-19: on the strip
   over a big drawing it was a chalk box). on the blackboard it hangs from the top right */
.end-sticky {
    font-family: var(--chalk-font);
    font-weight: 400;
    font-size: 12px;
    color: var(--red);
    background: var(--sticky-pink);
    border: none;
    border-radius: 0 0 2px 2px;
    padding: 10px 8px 4px;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.25);
}

.end-button {
    position: absolute;
    top: -6px;
    right: 12px;
}

/* pictures and colors on the board: on a little white paper, so black lines can be seen */
.board .pictogram {
    background: var(--paper);
    border-radius: 3px;
}

.board .swatch {
    border-color: var(--chalk);
}

/* ---------- play: under the board (the time, how many have finished) and the page ---------- */

/* a phone: the blackboard, the ruler, how many have finished, then the page (its top line is めあて) */
.play-side {
    display: contents;
}

.play-screen > .board-frame {
    order: 1;
}

.timer-box {
    order: 2;
}

.status-row {
    order: 3;
}

.aim-box {
    order: 4;
}

.play-work {
    order: 5;
}

/* only if a screen is too short for everything (a phone held sideways, 8 long names and a picture),
   the play screen itself scrolls, so 送る can always be reached. the page as a whole never scrolls */
.play-screen {
    overflow-y: auto;
}

/* the time left: a ruler with the yellow marker (the red marker for the last 10 seconds) */
.timer-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 2px;
}

.timer-text {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: var(--text-note);
    white-space: nowrap;
}

.ruler {
    position: relative;
    flex: 1;
    height: 16px;
    background-color: rgba(230, 240, 248, 0.95);
    background-image:
        repeating-linear-gradient(to right, #5b6b7d 0, #5b6b7d 1px, transparent 1px, transparent 8px),
        repeating-linear-gradient(to right, #5b6b7d 0, #5b6b7d 1px, transparent 1px, transparent 40px);
    background-size: 100% 4px, 100% 8px;
    background-repeat: no-repeat;
    border: 1px solid #8fa3b8;
    border-radius: 2px;
}

.ruler-marker {
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 2px;
    background: var(--marker-yellow);
}

.timer-box.is-short .ruler-marker {
    background: var(--marker-red);
}

.timer-box.is-short .timer-text {
    color: var(--red);
}

/* how many have finished this round, in one line (game.js showStatus. 2026-10-17 pineさん: not the names), then
   "みんなあなたを待っています", who cannot play now, and for the host "とばす" with the names to skip under it */
.status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 10px;
    padding: 0 2px;
    font-size: 13px;
}

.done-count {
    white-space: nowrap;
}

.status-row .skip-open-button {
    font-size: 12px;
    padding: 1px 10px;
    border-width: 1px;
    box-shadow: none;
}

/* someone who cannot play: gray, one line each (game.js makeAwayNoteText joins them with a line break).
   a nickname is not folded: the line folds after ・ and ： (keep-all), or anywhere only if one name is wider than the line */
.away-note {
    flex-basis: 100%;
    font-size: 12px;
    color: var(--ink-soft);
    white-space: pre-line;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

/* the names to skip (the host pressed "とばす"): small buttons, a gray "いない" in the button of someone gone */
.skip-list {
    flex-basis: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 2px 0 4px;
}

.skip-lead {
    font-size: 12px;
    color: var(--ink-soft);
}

.skip-list button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* the note of what came (game.js showReceivedNote): a yellow sticky note, like the one that brings the words at the
   start of a round. only on a phone, while the blackboard is put away (see the parts for a phone): a thin strip in
   the place of the blackboard while I make a way on the page (UI-1, q-band-others: everything but a drawing).
   the label is small, the words are big; a long message is smaller, never cut */
.received-note {
    display: none;
    position: relative;
    order: 1;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 10px 8px;
    background: linear-gradient(180deg, var(--sticky-yellow-top) 0, var(--sticky-yellow) 12px, var(--sticky-yellow) 100%);
    box-shadow: 0 3px 4px var(--shadow);
    rotate: -0.6deg;
}

/* the curled corner at the bottom right */
.received-note::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, transparent 50%, var(--shadow) 50%, transparent 100%);
}

.received-note-text {
    flex: 1;
    min-width: 0;
    font-size: 20px;
    line-height: 1.35;
}

.received-note-text:has(.is-long-text) {
    font-size: 16px;
}

.received-note-label {
    font-size: var(--text-note);
    color: var(--sticky-yellow-ink-dark);
}

/* やめる / 終わらせる hangs from the top edge of the note */
.received-note .end-sticky {
    margin-top: -6px;
}

/* someone who is gone (the page closed, or the connection was lost): the name is lighter, with a small label
   (game.js isAway. their turn is skipped after a while) */
.roll-line.is-away .roll-name {
    color: var(--ink-soft);
}

.away-tag {
    padding: 0 5px;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--ink-soft);
    border: 1px dashed var(--gray-edge);
    border-radius: 3px;
    white-space: nowrap;
}

/* everyone else has finished: the words with the red marker (inline, so the marker follows each line when they wrap) */
.wait-me-note {
    font-size: var(--text-note);
}

.wait-me-note > span {
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* めあて (what to do with the way, in one line: 2026-10-17 pineさん "目当てがいらない"): on a phone, the top line of
   the page */
.aim-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background-image: none;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    padding: 8px 12px 6px;
    /* no gap between the top line and the rest of the page */
    margin-bottom: -6px;
}

.play-screen:has(.aim-box:not([hidden])) .play-work {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.method-rule {
    font-size: var(--text-read);
    line-height: 1.6;
}

/* the name of the way: its picture, underlined with the blue marker */
.method-name {
    background: linear-gradient(transparent 60%, var(--marker-blue) 60%);
}

.method-name .line-icon {
    margin-right: 2px;
}

/* a hint (語呂合わせの例): a small green sticky note */
.hint-box {
    font-size: var(--text-note);
    background: var(--sticky-green);
    box-shadow: 1px 2px 0 var(--shadow);
    padding: 3px 8px;
}

/* the page for making: it takes the rest of the height.
   it is never shorter than what is in it (a word round: the box and 送る),
   and with the cards or a way, never shorter than 240px (they scroll inside). if the screen is shorter, the screen scrolls */
.play-work {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px 10px;
}

.play-work:has(> .choice-box:not([hidden])),
.play-work:has(> .method-box:not([hidden])) {
    min-height: 240px;
}

.word-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

/* the two topic buttons, side by side (they go to the next line only on a very narrow screen) */
.topic-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* the cards of the ways: sticky notes held with tape, each a little tilted.
   they are spread out evenly over the page (not packed at the top), with at least 14px between them,
   so the tape and the tilt of one never touch the next.
   (margin-block: auto on each card shares the free space; when there is none, it is 0 and the cards scroll) */
.choice-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    overflow-y: auto;
    /* room for the tape and the tilt, so nothing is cut off */
    padding: 10px 6px 6px;
}

.choice-box > button {
    margin-block: auto;
}

/* (a computer puts the keyboard on the box of the cards or of the items at a new round, not on the first one: a ring
   on the first card looked chosen. the box itself has no ring. 2026-10-17 q-focus-card) */
.choice-box:focus,
.palette-box:focus {
    outline: none;
}

/* a phone: the cards never scroll inside their box, only the screen does (the evening of 2026-10-16: at 320×568 the
   box and the screen both scrolled, and only one card could be seen whole) */
@media (max-width: 899px) {
    .choice-box {
        flex: 1 0 auto;
        overflow-y: visible;
    }
}

.choice-box button {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 10px;
    align-items: center;
    width: 100%;
    text-align: left;
    border: none;
    border-radius: 2px;
    padding: 9px 12px 8px;
    box-shadow: 1px 3px 4px var(--shadow);
}

.choice-box button::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 18px;
    width: 46px;
    height: 12px;
    background: var(--tape);
    transform: rotate(-4deg);
}

.choice-box button:nth-child(3n+1) { background: var(--sticky-yellow); transform: rotate(-0.8deg); }
.choice-box button:nth-child(3n+2) { background: var(--sticky-pink); transform: rotate(0.6deg); }
.choice-box button:nth-child(3n) { background: var(--sticky-blue); transform: rotate(-0.4deg); }

.choice-box button:active {
    transform: translate(1px, 2px);
}

.choice-box .line-icon {
    grid-row: span 2;
    width: 28px;
    height: 28px;
}

.choice-rule {
    display: block;
    font-size: var(--text-note);
    font-weight: 400;
    margin-top: 2px;
}

/* the box for making the message takes the room that is left */
.method-box {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.palette-area,
.text-area {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
}

.chosen-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* what I made: a slip of paper with a dashed edge */
.chosen-box,
.preview-box {
    flex: 1;
    font-size: 22px;
    min-height: 36px;
    background: var(--white);
    border: 1.5px dashed var(--ink-soft);
    padding: 4px 10px;
}

/* what I chose never takes more than about 2 lines, so the palette below always has room
   (more lines scroll inside the slip). long items (顔文字, オノマトペ, 花言葉) get smaller letters */
.chosen-box {
    max-height: 72px;
    overflow-y: auto;
}

/* colors and pictograms in the slip: small, so all 10 fit in 2 lines on a phone
   (a pictogram a little bigger: at 22px it was hard to tell which one was chosen. 2026-10-16 UI-12) */
.chosen-box .swatch,
.chosen-box .pictogram {
    width: 22px;
    height: 22px;
    margin: 1px;
}

.chosen-box .pictogram {
    width: 32px;
    height: 32px;
}

.chosen-box.is-long {
    font-size: 15px;
}

.chosen-count,
.draw-count,
.preview-label {
    font-size: var(--text-note);
    color: var(--ink-soft);
}

/* letters that cannot be used: written with the red pen. small warnings take its dark red (2026-10-16 UI-28: the red
   was 4.4:1 on the paper, under 4.5:1 for small letters. the dark red is 7.1:1) */
.preview-label.is-warning,
.word-warning {
    color: var(--red-dark);
    font-size: var(--text-note);
}

/* in the preview: the letters that stop 送る, crossed out with the red pen (game.js showPreview) */
.stopped-letter {
    color: var(--red-dark);
    text-decoration-color: var(--red);
    text-decoration-thickness: 2px;
}

/* 送る while the message cannot be sent (aria-disabled): pale, like a button that cannot be pressed. pressing it still
   says why (2026-10-16 UX-7) */
.send-button[aria-disabled="true"] {
    opacity: 0.45;
}

/* the letters of the message I received: crossed out with the red pen */
.banned-letters {
    font-size: var(--text-note);
    color: var(--red-dark);
    letter-spacing: 0.15em;
}

/* the tabs of the emoji (顔・人・動物 …): index tabs, big enough to press (2026-10-16 UI-13: 22px tall and 11px letters,
   in 2 lines on a narrow phone, which pushed the items down). always one line: the tabs that do not fit are scrolled
   to sideways, and the right end fades to show that there are more (the room at the end lets the last tab come out
   of the fade; scroll-padding keeps a chosen tab out of it too) */
.tab-box {
    display: flex;
    flex-shrink: 0;
    gap: 4px;
    overflow-x: auto;
    padding-right: 28px;
    scroll-padding-inline-end: 28px;
    scrollbar-width: thin;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}

.tab-box button {
    flex-shrink: 0;
    min-height: 36px;
    font-size: var(--text-note);
    padding: 2px 12px;
    background: #f4f1e8;
    border: 1px solid var(--paper-edge);
    border-radius: 3px 3px 0 0;
    box-shadow: none;
}

/* palette buttons: still big enough to tap on a phone */
.palette-box {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 0;
    overflow-y: auto;
}

.palette-box button {
    min-width: 40px;
    height: 40px;
    font-size: 18px;
    border: 1px solid #8f96a6;
    border-radius: var(--sketch-small);
    padding: 2px 6px;
    box-shadow: none;
}

/* a small word under the item: the name of the flower under its meaning (花言葉), the readings of a number (ポケベル)
   (2026-10-16 UI-12: they were 9px. the meaning, sent to the next person, was the smallest letters of the screen) */
.palette-box button small {
    display: block;
    font-size: var(--text-label);
    font-weight: 400;
    line-height: 1.1;
}

/* a button with a small word under it (花言葉, colors) */
.palette-box button:has(small) {
    height: 52px;
    font-size: var(--text-read);
}

/* colors: the button is painted with its color, and its name is on a small white tag */
.palette-box .swatch-button {
    min-width: 52px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 3px;
}

.palette-box .swatch-button small {
    font-size: var(--text-label);
    background: rgba(255, 255, 255, 0.85);
    border-radius: 4px;
    padding: 0 3px;
}

/* the words of a message: what I chose, the preview, what came on the blackboard and the results (the same parts
   everywhere: game.js showMessageText, 2026-10-16 UI-8. "キンモクセ／イ", "ハロウ／ィン" and "にげ／る" were folded
   in the middle). a line folds between phrases (auto-phrase: Chrome. a browser without it folds between letters, as
   before), never with a small letter or ー at its head (strict), and a run with no place to fold (numbers) anywhere.
   a message with spaces folds only at its spaces (has-spaces: auto-phrase cut "おる／すばん" of "ドラゴンの　おるすばん").
   each item of a palette way goes to the next line as a whole, and is folded inside only when it is wider than
   the line by itself.
   the other words of the screens fold the same way (the evening of 10/16: "えらんでくださ／い" in めあて, "おま／かせ" and
   "さわると大きくなり／ます" on the blackboard, "よろし／く" in the hint): めあて (and its hint), the words of the
   blackboards and the waiting note (the parts inside them inherit it). a nickname is not words: it never folds
   (.roll-name-text, .skip-list button) */
.message-words,
.aim-box,
.draw-howto,
.role-title,
.received-label,
.host-note,
.lobby-message,
.waiting-message {
    word-break: normal;
    word-break: auto-phrase;
    line-break: strict;
    overflow-wrap: anywhere;
}

.message-words.has-spaces,
.message-item {
    word-break: keep-all;
}

/* a message to read (on the blackboard, on the strip over the drawing board, in the results): lines of even length,
   so one or two letters are not left alone on the last line ("ねこがさかなをくわえてに／げる" on a computer).
   not in the slips I am making: they would jump while I type */
.received-message,
.draw-topic-text,
.result-words,
.compare-words {
    text-wrap: balance;
}

.message-item {
    display: inline-block;
    max-width: 100%;
}

/* a color in a message: a small square painted by hand */
.swatch {
    display: inline-block;
    width: 28px;
    height: 28px;
    margin: 2px;
    border: 2px solid var(--ink);
    border-radius: var(--sketch-small);
    vertical-align: middle;
}

.received-message .swatch {
    width: 36px;
    height: 36px;
}

/* pictograms: the button shows the picture, and its name is small under it (only I see it)
   (button.pictogram-button: stronger than "button:has(small)" above, so the button can be taller.
   room for a name of 2 lines: the names are --text-label now, and a long one like キャンプファイア folds) */
.palette-box button.pictogram-button {
    width: 64px;
    height: 74px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 2px;
}

.palette-box .pictogram-button small {
    line-break: strict;
}

.palette-box .pictogram-button .pictogram {
    width: 40px;
    height: 40px;
    margin: 0;
}

/* a pictogram in a message */
.pictogram {
    display: inline-block;
    width: 32px;
    height: 32px;
    margin: 2px;
    vertical-align: middle;
}

.received-message .pictogram {
    width: 44px;
    height: 44px;
}

/* 鏡文字: the letters are turned left to right */
.is-mirror {
    display: inline-block;
    transform: scaleX(-1);
}

/* 割符: only the top 4 tenths of the letters can be seen
   (line-height 1.2 puts 0.1em of room above the letters, so 0.5em shows 0.4em of them) */
.is-half {
    display: inline-block;
    height: 0.5em;
    overflow: hidden;
    line-height: 1.2;
    vertical-align: top;
}

/* ---------- voice ---------- */

/* ケータイ打ち: 12 keys like an old phone (3 across, 4 down), as tall as the room allows (but not huge on a computer).
   touch-action: manipulation stops a fast second press from zooming the page, and user-select stops a long press from choosing letters */
.keypad-area {
    flex: 1;
    min-height: 0;
    display: flex;
    justify-content: center;
}

/* the 12 places of the keys of a phone (3 across, 4 down): ケータイ打ち, and ポケベル (2026-10-16 UI-15: its numbers
   were 7 in a line, then 8 9 0) */
.keypad-box,
.palette-box.is-keys {
    max-width: 320px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.keypad-box {
    flex: 1;
    max-height: 260px;
    grid-template-rows: repeat(4, minmax(34px, 1fr));
}

/* ポケベル: each number big, with its readings under it (the hint only gives examples now). a last item alone in its
   line (0) is in the middle of it, like a phone */
.palette-box.is-keys {
    width: 100%;
    align-self: center;
}

.palette-box.is-keys button {
    width: auto;
    height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1.1;
}

.palette-box.is-keys button:last-child:nth-child(3n + 1) {
    grid-column: 2;
}

/* a short phone (700px tall or less) or a screen held sideways: the keys are 44px, and the box is never cut shorter
   than its 4 lines (2026-10-16 review: at 320×568 and 740×360 the 0 was under the edge of the box, and could be pressed
   only after scrolling the box. at 320×568 the 4 lines are still 11px taller than the room: the screen scrolls those
   11px, and 送る, which stays at the bottom, covers nothing but its own place) */
@media (max-width: 899px) and (max-height: 700px), (max-height: 499px) and (orientation: landscape) {
    .palette-box.is-keys {
        flex-shrink: 0;
    }

    .palette-box.is-keys button {
        height: 44px;
    }
}

.keypad-key {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0;
    font-size: 17px;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.keypad-number {
    font-size: var(--text-label);
    color: var(--ink-soft);
}

/* # 1字消す (held: everything. keypad.js) in the dark red pen */
.keypad-key.is-erase .keypad-name {
    font-size: 14px;
    color: var(--red-dark);
}

/* a press: only a short flash of the yellow marker (yellow = what I am choosing now). the letter is not shown */
.keypad-key.is-pressed {
    animation: keypad-flash 0.2s;
}

@keyframes keypad-flash {
    from {
        background-color: var(--marker-yellow);
    }
}

/* everything was taken back (# held): a longer flash of the red marker (red = careful) */
.keypad-key.is-cleared {
    animation: keypad-clear-flash 0.6s;
}

@keyframes keypad-clear-flash {
    from {
        background-color: var(--marker-red);
    }
}

.voice-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* the big button of the voice: the record button, or (逆再生まねボイス) the step to do now (game.js showGuideSteps,
   2026-10-16 UI-21: ① was small and ② was the biggest from the start). the other steps are small, like sub-button.
   also the button to listen to a voice that came, in the middle of its frame on the blackboard (2026-10-16 UI-2: it
   was a small chalk box, like 部屋を出る, and 送る under it was what the eye found. written with the pen, not chalk) */
.listen-button {
    align-self: center;
    font-family: var(--hand);
    font-weight: 600;
}

.record-button,
.guide-row .is-now,
.listen-button {
    width: min(100%, 280px);
    padding: 18px;
    font-size: 20px;
    background: var(--sticky-blue);
    border-width: 2px;
    border-color: var(--ink);
    box-shadow: 2px 3px 0 var(--shadow);
}

.voice-area.has-guide .record-button:not(.is-now) {
    width: auto;
    background: var(--white);
}

/* recording: circled with the red pen */
.record-button.is-recording,
.guide-record-button.is-recording {
    background: var(--sticky-pink);
    border-color: var(--red);
    color: var(--red);
}

/* ボイス・逆再生まね: the guide (お手本) buttons, side by side above the record button */
.guide-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.voice-status {
    font-size: var(--text-note);
    text-align: center;
    min-height: 1.4em;
}

/* ---------- the drawing board: like a design tool (2026-10-09 pineさん) ----------
   a phone: the colors on top, the tools in a column on the left of the board, the count under it.
   a computer: see the wide screen part (the tools on the left, the colors and 送る on the right).
   (a grid with names: each part goes to its place. row-gap is 0 and each part has its own margin,
   so a part that is hidden, like the colors of FAX, leaves no empty gap) */
.draw-area {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas:
        "topic topic"
        "colors colors"
        "tools stage"
        "count count";
    column-gap: 6px;
}

/* 広げたとき: what came, on a strip of the blackboard (the blackboard itself is put away then),
   and "終わらせる / やめる" at its right end */
.draw-topic {
    grid-area: topic;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    padding: 3px 10px;
    font-family: var(--chalk-font);
    font-weight: 400;
    font-size: 14px;
    color: var(--chalk);
    background: var(--board);
    border: 3px solid var(--wood);
    border-radius: 3px;
}

.draw-topic-text {
    flex: 1;
    min-width: 0;
}

/* やめる / 終わらせる hangs from the top edge of the strip, like on the blackboard (away from the tools under it) */
.draw-topic .end-sticky {
    align-self: flex-start;
    margin-top: -6px;
}

/* the tools: a column of small buttons (on a phone, only the pictures: the names are for screen readers).
   on a very short screen the column scrolls, so it never pushes the board */
.draw-tools {
    grid-area: tools;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-height: 0;
    overflow-y: auto;
    /* room for the shadows of the buttons */
    padding: 1px 3px 3px 1px;
}

.tool-button,
.width-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 34px;
    height: 30px;
    padding: 0;
    font-size: 13px;
    border-width: 1.5px;
    border-color: var(--ink-soft);
    border-radius: var(--sketch-small);
    box-shadow: 1px 2px 0 var(--shadow);
}

.tool-button .line-icon {
    width: 18px;
    height: 18px;
}

.tool-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* the pen or eraser in use, and the width chosen: the yellow marker (yellow = chosen) */
.tool-button[aria-pressed="true"],
.width-button[aria-pressed="true"] {
    background: var(--marker-yellow);
    border-color: var(--yellow-edge);
}

/* the focus mark is drawn inside the button: the column of tools scrolls on a short screen
   (a mark outside the button would be cut off) */
.draw-tools .tool-button:focus-visible,
.draw-tools .width-button:focus-visible {
    outline-offset: -5px;
}

/* the widths: a short line as thick as the line it draws (painted with the pen now by game.js) */
.width-box {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.width-button {
    height: 26px;
}

.width-line {
    width: 20px;
    border-radius: 999px;
    background: var(--ink);
    /* a thin edge, so a white (eraser) or yellow line can be seen */
    box-shadow: 0 0 0 1px rgba(45, 51, 64, 0.35);
}

/* the board itself takes the room that is left, and tells its size to the canvas inside
   (container-type: size lets the canvas use cqw / cqh = 1% of this place's width / height) */
.draw-stage {
    grid-area: stage;
    min-width: 0;
    min-height: 0;
    container-type: size;
    display: flex;
    justify-content: center;
    /* (not stretched to the height of this place: the canvas stays a square) */
    align-items: flex-start;
}

/* the board and the words lying on it (the board still takes its size from the stage: cqw and cqh below) */
.draw-sheet {
    position: relative;
}

/* how the tool works (直線・曲線・丸・四角), pale in the middle of the empty board (game.js showDrawCount).
   as big as the board allows (cqmin: the stage, whose smaller side is the board): on a small board (小さく on a
   phone, 156px) 14px letters were 9 lines, taller than the board, over めあて and the count (2026-10-17 review).
   never outside the board, and not at all on a board under 150px */
.draw-howto {
    position: absolute;
    left: 10%;
    right: 10%;
    top: 50%;
    translate: 0 -50%;
    max-height: 92%;
    overflow: hidden;
    margin: 0;
    text-align: center;
    font-size: 14px;
    font-size: clamp(12px, 4cqmin, 15px);
    line-height: 1.5;
    color: var(--ink-soft);
    pointer-events: none;
}

@container (max-width: 149px) or (max-height: 149px) {
    .draw-howto {
        display: none;
    }
}

/* my drawing board: a white square sheet, as big as the room allows
   (touch-action: none stops the page from moving while drawing.
   the first width is for old browsers. border-box: the edge is inside the size, so the square never spills out) */
.draw-canvas {
    display: block;
    box-sizing: border-box;
    width: min(100%, 40dvh);
    width: min(100cqw, 100cqh);
    aspect-ratio: 1;
    border: 2px solid var(--ink);
    border-radius: var(--sketch-small);
    touch-action: none;
    background: var(--white);
}

/* the colors: squares of paint in a row (2026-10-16 UI-11: round paints looked like the dots of the widths) */
.color-box {
    grid-area: colors;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 6px;
}

.color-button {
    width: 23px;
    height: 23px;
    padding: 0;
    border: 1.5px solid rgba(45, 51, 64, 0.45);
    border-radius: var(--sketch-small);
    box-shadow: none;
}

/* the color in use: a ring of ink around it (a yellow ring would not be seen around the yellow paint) */
.color-button[aria-pressed="true"] {
    box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--ink);
}

.draw-count {
    grid-area: count;
    margin-top: 4px;
    text-align: center;
}

/* the 2 buttons that open the widths and the colors: only on a phone (the media part below) */
.width-toggle-button,
.color-toggle-button {
    display: none;
}

/* the width in use: a short line of its thickness and color / the color in use: a square of paint, like the colors */
.toggle-dot {
    display: block;
    width: 24px;
    border-radius: 999px;
    box-shadow: 0 0 0 1px var(--shadow);
}

.toggle-swatch {
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    box-shadow: 0 0 0 1px var(--shadow);
}

/* ---------- a phone (2026-10-13 pineさん "色ボタン1つにまとめる"): the widths and the colors are one button each.
   pressing it opens a panel of big buttons in the middle of the screen (over the board), and choosing one closes it
   (game.js toggleDrawPanel). the rows of colors and widths took height from the board ---------- */
@media (max-width: 899px) {
    .draw-tools .width-toggle-button,
    .draw-tools .color-toggle-button {
        display: inline-flex;
    }

    .draw-tools .color-toggle-button[hidden] {
        display: none;
    }

    .draw-area .width-box,
    .draw-area .color-box {
        display: none;
    }

    .draw-area.is-width-open .width-box,
    .draw-area.is-color-open .color-box {
        position: fixed;
        left: 50%;
        top: 50%;
        translate: -50% -50%;
        z-index: 20;
        display: grid;
        gap: 10px;
        width: min(92vw, 340px);
        box-sizing: border-box;
        margin: 0;
        padding: 14px;
        background: var(--white);
        border: 2px solid var(--ink);
        border-radius: var(--sketch-small);
        box-shadow: 3px 4px 0 var(--shadow);
    }

    .draw-area.is-color-open .color-box[hidden] {
        display: none;
    }

    .draw-area.is-color-open .color-box {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .draw-area.is-width-open .width-box {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .play-screen .draw-area.is-color-open .color-button {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    .play-screen .draw-area.is-width-open .width-button {
        width: 100%;
        height: 52px;
    }

    .play-screen .draw-area.is-width-open .width-line {
        width: 60%;
    }
}

/* ---------- 広げる (only while drawing): the blackboard is put away, so the drawing board gets the height
   of the screen (on a computer, the side is put away too: see the wide screen part) ---------- */
.play-screen.is-big-drawing > .board-frame {
    display: none;
}

/* waiting: a sticky note (a skipped turn says why in the first line, and who we wait for in the second:
   pre-line keeps the line break of game.js makeWaitingText) */
.waiting-message {
    text-align: center;
    background: var(--sticky-yellow);
    box-shadow: 1px 2px 0 var(--shadow);
    padding: 8px;
    white-space: pre-line;
}

/* while waiting: a column of the textbook (a true story of a way to send messages) */
.trivia-box {
    background: var(--white);
    border: 1.5px solid var(--ink-soft);
    border-radius: var(--sketch-small);
    padding: 6px 10px 8px;
    font-size: 13px;
    line-height: 1.6;
}

.trivia-title {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* the heading is marked with the blue marker (blue = a heading) */
.trivia-label {
    flex-shrink: 0;
    font-weight: bold;
    color: var(--blue-pen);
    background: linear-gradient(transparent 60%, var(--marker-blue) 60%);
}

/* the name of the way: one line (… when it is long) */
.trivia-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.trivia-title .sub-button {
    font-size: 12px;
    padding: 2px 8px;
}

/* only 2 lines until "つづき" is pressed. opened, a long story scrolls inside the column */
.trivia-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.trivia-box.is-open .trivia-text {
    display: block;
    max-height: 9.6em;
    overflow-y: auto;
}

/* the margin to doodle in: all the rest of the page. the canvas is see-through, so the ruled lines show
   (the canvas is placed over its box, so the box decides the size and the canvas never pushes the page longer.
   touch-action: none stops the page from moving while drawing) */
.doodle-area {
    flex: 1;
    min-height: 0;
    position: relative;
}

.doodle-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
    color: var(--ink);
}

/* (pointer-events: none lets the finger go through the words to the canvas) */
.doodle-hint {
    position: absolute;
    top: 4px;
    left: 0;
    color: var(--ink-soft);
    font-size: 12px;
    pointer-events: none;
}

.doodle-clear-button {
    position: absolute;
    top: 0;
    right: 0;
}

/* for a moment after the round changes, nothing on the page can be pressed
   (a quick tap meant for the doodle would choose a card of the next round) */
.play-work.is-resting {
    pointer-events: none;
}

.play-work .bottom-row {
    margin-top: auto;
}

.send-button {
    flex: 1;
    font-size: 19px;
    letter-spacing: 0.3em;
}

/* ---------- results: announced on the blackboard, written on the page ---------- */

.result-board {
    align-items: center;
    text-align: center;
    gap: 2px;
    padding: 12px 14px;
}

.result-title {
    font-size: 26px;
    letter-spacing: 0.2em;
}

.result-sub {
    font-size: 13px;
    color: var(--chalk-yellow);
}

/* save the picture: a sticky note at the top right of the board */
.picture-button {
    position: absolute;
    top: -6px;
    right: 12px;
    font-size: 12px;
    background: var(--sticky-blue);
    border: none;
    border-radius: 0 0 2px 2px;
    padding: 10px 8px 4px;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.25);
}

/* (position: relative: the note "とまっています" is stuck on its top edge) */
.result-paper {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 14px;
}

/* the lines take the room that is left (only the list scrolls if there are many).
   (container-type: size: a drawing is never taller than the list, 100cqh = the list's height. the list's height
   comes from the screen, never from its lines, so this changes nothing else) */
.result-list {
    position: relative;
    container-type: size;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* alone: what the robots are, at the head of the results (2026-10-16 UX-21) */
.solo-result-note {
    font-size: 12px;
    color: var(--ink-soft);
}

/* the lines are stopped (止める): a pink sticky note stuck between the board and the page, on everyone's screen
   (over them, so the lines do not move when it comes and goes. it hangs over the page only a little: no words there) */
.paused-note {
    position: absolute;
    top: -20px;
    right: 14px;
    z-index: 2;
    font-size: 13px;
    color: var(--red-dark);
    background: var(--sticky-pink);
    border-radius: 0 0 2px 2px;
    padding: 5px 12px 3px;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.25);
    pointer-events: none;
}

/* one entry: who wrote it and what kind (small), then what they wrote (big) */
.result-entry {
    display: flex;
    flex-direction: column;
}

.result-head {
    font-size: 12px;
    color: var(--ink-soft);
}

.result-text {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    font-size: 21px;
}

/* the topic: the yellow marker (on the results and on the comparison), under each line of the words when they fold
   (an inline box, cloned on each line: 2026-10-16 UI-9) / what was sent with a way: the blue pen */
.marked-words {
    background: linear-gradient(transparent 50%, var(--marker-yellow) 50%);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.result-text.is-sent {
    font-size: 19px;
    color: var(--blue-pen);
}

/* a pencil arrow between the entries: under the head of the words, like the arrow of the comparison
   (2026-10-16 UI-16: in the middle of the page it was far from the lines, which are on the left) */
.result-arrow {
    align-self: flex-start;
    padding-left: 2px;
    color: var(--ink-soft);
    line-height: 0;
}

.result-arrow .line-icon {
    width: 20px;
    height: 20px;
}

/* a heading: underlined with the blue marker */
.result-heading {
    align-self: flex-start;
    font-size: 14px;
    margin-top: 8px;
    border-bottom: 3px solid var(--marker-blue);
}

/* (tap it to see it big: zoom-in is the magnifying glass mouse pointer) */
.result-canvas {
    display: block;
    width: 96px;
    aspect-ratio: 1;
    border: 1px solid var(--rule);
    background: var(--white);
    cursor: zoom-in;
}

/* all the chains at once: one box for each chain (on a computer, the boxes stand side by side) */
.result-chain {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* all the chains at once: smaller, one entry in a line, no arrows */
.result-list.is-summary .result-arrow {
    display: none;
}

.result-list.is-summary .result-entry {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 8px;
    border-left: 3px solid var(--rule);
    padding-left: 8px;
    margin: 2px 0;
}

.result-list.is-summary .result-text {
    font-size: 16px;
}

/* a drawing: the name at the top, next to the picture (not at its bottom) */
.result-list.is-summary .result-entry:has(canvas) {
    align-items: flex-start;
}

.reveal-note {
    font-size: 12px;
    color: var(--ink-soft);
    text-align: center;
}

.result-paper .bottom-row {
    flex-wrap: wrap;
    justify-content: center;
}

/* ◀ 1行もどる and 止める / つづける: a line picture and the words */
.line-back-button,
.pause-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* words only on a wide screen: on a phone, "この伝言をもう一度見る" is "もう一度見る" (2026-10-16 UX-14) */
@media (max-width: 899px) {
    .wide-words {
        display: none;
    }
}

/* the line under the title of the results: "1 / 8本" and "9 / 9行" are never cut (2026-10-16 UI-29) */
.result-sub-part:not(:first-child) {
    white-space: nowrap;
}

.next-button,
.new-game-button {
    flex: 1;
    font-size: 17px;
}

/* (the results on a phone: "次の伝言へ" takes the rest of the line and never gets narrower than its words. on a very
   narrow phone it goes to a second line instead of folding its words into 3 lines. a computer: as wide as its words,
   at the right end with the others: 2026-10-17 pineさん q-next-button, it was as wide as the whole line) */
@media (max-width: 899px) {
    .result-paper .bottom-row .next-button {
        flex: 1 0 auto;
        white-space: nowrap;
    }
}

/* ---------- the screening (上映会, 2026-10-13): the lines of a message come out one by one ---------- */

/* while the lines come out, "答えまでとばす" is a quiet pencil button (the lines are the fun part: not to be skipped
   by a big red button). on the comparison the same button is "次の伝言へ", red again */
.result-paper .next-button.sub-button {
    flex: none;
    font-size: 13px;
    padding: 5px 12px;
    color: var(--ink);
    background: var(--white);
    border-width: 1.5px;
    border-color: var(--ink-soft);
    box-shadow: 1px 2px 0 var(--shadow);
}

/* the screening (2026-10-18 pineさん "出ている情報はお題と伝言の2つにして／次お題が出たらスライドして前のお題は表示から
   外れて／次伝言が出たら前の伝言は表示から外れて"): 2 places, the お題 (the topic, then each guess) and the 伝言 (the
   newest way), with the pencil arrow from the one to the other. a phone held upright: the お題 on top, the 伝言 under it
   with the rest of the height (its drawing as big as that). game.js makeScreening / fillScreenSlot */
.screening {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    gap: 4px;
    /* (the お題 in the top 2/5 and the 伝言 in the bottom 3/5, each in the middle of its part: words and emoji do not
       leave one big empty part. a drawing takes all the height under the お題, below) */
    grid-template-rows: minmax(min-content, 2fr) auto minmax(0, 3fr);
    grid-template-areas:
        "word"
        "arrow"
        "way";
}

.screening:has(.screen-slot.is-way .result-canvas) {
    grid-template-rows: auto auto minmax(0, 1fr);
}

/* (the name of a place stays with its card, both in the middle of the place) */
.screen-slot {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    min-height: 0;
}

.screen-slot.is-word {
    grid-area: word;
}

.screen-slot.is-way {
    grid-area: way;
}

/* "お題" and "伝言": small, in the blue pen of the headings */
.screen-label {
    font-size: 12px;
    line-height: 1.4;
    color: var(--blue-pen);
}

/* the stage of a place: the old and the new card lie in the same cell while they slide (what slides out to the
   side is not shown). a card taller than its place (10 flowers) scrolls, from its top (safe center), never cut
   (2026-10-18 review) */
.screen-stage {
    flex: 0 1 auto;
    min-height: 0;
    display: grid;
    align-content: center;
    align-content: safe center;
    overflow-x: hidden;
    overflow-y: auto;
}

/* a place with a drawing: its stage and its card take the whole place. the card is its head and the rest, and the
   drawing is as big as the rest (100cqw, 100cqh of .result-text): a head of 2 lines (a long nickname and the name of
   the way) makes it a little smaller instead of pushing it out (2026-10-18 review) */
.screen-slot:has(.result-canvas) .screen-stage {
    flex: 1 1 auto;
    grid-template-rows: minmax(0, 1fr);
    align-content: stretch;
}

.screen-card:has(.result-canvas) {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
}

.screen-card:has(.result-canvas) .result-text {
    container-type: size;
    min-height: 0;
}

.screen-stage > * {
    grid-area: 1 / 1;
    min-width: 0;
}

/* (2 lines kept for the お題: a short guess after a long topic does not make the 伝言 and its drawing jump) */
.screen-slot.is-word .screen-stage {
    min-height: 92px;
}

.screen-card {
    padding: 2px 8px 4px;
}

/* the place of the newest entry: the yellow marker of "now" on its left */
.screen-slot.is-now .screen-card {
    box-shadow: inset 4px 0 0 var(--marker-yellow);
}

/* the topic is out, its 伝言 not yet: a dashed empty place */
.screen-slot.is-empty .screen-stage {
    flex: 1 1 auto;
    border: 1.5px dashed var(--rule);
    border-radius: 6px;
}

.screen-arrow {
    grid-area: arrow;
    justify-self: start;
    padding-left: 10px;
    line-height: 0;
    color: var(--ink-soft);
}

.screen-arrow .line-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s;
}

/* a guess: the arrow goes from the 伝言 up to the お題 that was imagined from it */
.screening.is-guess .screen-arrow .line-icon {
    transform: rotate(180deg);
}

.screening .result-head {
    font-size: 15px;
}

.screening .result-text {
    font-size: 26px;
}

.screening .result-text.is-sent {
    font-size: 30px;
}

/* (pictograms and colors as big as the words around them: they are the 伝言 itself) */
.screening .pictogram {
    width: 56px;
    height: 56px;
}

.screening .swatch {
    width: 44px;
    height: 44px;
}

/* (a long topic or guess: smaller, so it takes fewer lines from the 伝言 under it) */
.screening .screen-card.is-long .result-text {
    font-size: 20px;
}

.screening .result-canvas {
    width: min(300px, 100%);
    width: min(300px, 100cqw, max(96px, 100cqh));
}

/* the slide: the new card comes in from the right, the old one goes out to the left (the way the sticky note of a
   round comes). 1行もどる: the other way */
.screen-card.is-entering {
    animation: screen-in 0.45s ease-out;
}

.screen-card.is-leaving {
    animation: screen-out 0.45s ease-in forwards;
    pointer-events: none;
}

.screen-card.is-entering.is-back {
    animation-name: screen-in-back;
}

.screen-card.is-leaving.is-back {
    animation-name: screen-out-back;
}

@keyframes screen-in {
    from {
        opacity: 0;
        transform: translateX(60%);
    }
}

@keyframes screen-out {
    to {
        opacity: 0;
        transform: translateX(-60%);
    }
}

@keyframes screen-in-back {
    from {
        opacity: 0;
        transform: translateX(-60%);
    }
}

@keyframes screen-out-back {
    to {
        opacity: 0;
        transform: translateX(60%);
    }
}

/* a computer and a phone held sideways: the お題 on the left, the 伝言 on the right, each in the middle of its half
   (the drawing gets bigger than one under the other: measured 1280×800 374 → 416px). the arrow points right
   (to the 伝言), or left for a guess */
@media (min-width: 900px), (max-height: 499px) and (orientation: landscape) {
    .screening {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        grid-template-areas: "word arrow way";
        gap: 12px;
    }

    .screening:has(.screen-slot.is-way .result-canvas) {
        grid-template-rows: minmax(0, 1fr);
    }

    .screen-slot.is-word .screen-stage {
        min-height: 0;
    }

    .screen-stage {
        justify-items: center;
        text-align: center;
    }

    .screen-arrow {
        align-self: center;
        padding-left: 0;
    }

    .screen-label {
        text-align: center;
    }

    .screen-arrow .line-icon {
        transform: rotate(-90deg);
    }

    .screening.is-guess .screen-arrow .line-icon {
        transform: rotate(90deg);
    }
}

/* the comparison: the topic and the last answer of a message, big, on a white card
   (the red はなまる of the teacher on the answer when they are just the same) */
.result-compare {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 16px 12px;
    margin-bottom: 4px;
    background: var(--white);
    border: 2px solid var(--ink);
    border-radius: var(--sketch-small);
    box-shadow: 2px 3px 0 var(--shadow);
}

.compare-line {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 10px;
    margin: 0;
}

/* the answer with a はなまる keeps room on its right for it (a long answer folds before it, never under it) */
.result-compare.is-perfect .compare-line.is-answer {
    padding-right: 58px;
}

.compare-label {
    font-size: 13px;
    color: var(--ink-soft);
}

.compare-words {
    font-size: 26px;
    line-height: 1.35;
}

.compare-arrow {
    color: var(--ink-soft);
    line-height: 0;
    padding-left: 2.5em;
}

.compare-arrow .line-icon {
    width: 20px;
    height: 20px;
}

/* the はなまる: the same drawing as on the entrance's notebook, drawn with the red pen line by line
   (pathLength is 1, so a dash of 1 is the whole line: the offset goes from 1 to 0 to draw it) */
.compare-hanamaru {
    position: absolute;
    right: -4px;
    top: 50%;
    translate: 0 -50%;
    width: 60px;
    height: 60px;
    fill: none;
    stroke: var(--red);
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.9;
    transform: rotate(-12deg);
    pointer-events: none;
}

.compare-hanamaru path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: hanamaru-draw 0.7s ease-in-out 0.4s forwards;
}

.compare-hanamaru path + path {
    animation-delay: 1.05s;
}

@keyframes hanamaru-draw {
    to {
        stroke-dashoffset: 0;
    }
}

.compare-praise {
    font-size: 15px;
    color: var(--red);
}

/* the big comparison holds its last answer back for a moment: "さいごの答えは……" (game.js answerHold, 2026-10-16 UX-3).
   then the answer pops out, bigger than the topic, and its はなまる is drawn (the drawing starts when it can be seen) */
.result-compare.is-held .compare-line.is-answer .compare-words,
.result-compare.is-held .compare-hanamaru,
.result-compare.is-held .compare-praise {
    display: none;
}

.result-compare.is-held .compare-line.is-answer .compare-label {
    font-size: 18px;
    animation: answer-wait 0.6s ease-in-out infinite alternate;
}

@keyframes answer-wait {
    from {
        opacity: 0.4;
    }

    to {
        opacity: 1;
    }
}

.result-compare:not(.is-small) .compare-line.is-answer .compare-words {
    font-size: 32px;
    transform-origin: left center;
    animation: answer-pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1);
}

@keyframes answer-pop {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* the small comparison on top of each message of the last step: already drawn, no movement */
.result-compare.is-small {
    padding: 4px 10px 6px;
    border-width: 1px;
    box-shadow: none;
}

.result-compare.is-small .compare-arrow {
    display: none;
}

.result-compare.is-small .compare-label {
    font-size: 11px;
}

.result-compare.is-small .compare-words {
    font-size: 17px;
}

.result-compare.is-small .compare-hanamaru {
    width: 36px;
    height: 36px;
}

.result-compare.is-small.is-perfect .compare-line.is-answer {
    padding-right: 36px;
}

.result-compare.is-small .compare-hanamaru path {
    animation: none;
    stroke-dashoffset: 0;
}

/* "そのまま伝わった": a small table over all the messages (on a computer, across the whole width), one row for each
   way: its picture and name on the left, "2 / 3" on the right. the ways that passed the words on have the red pen
   (2026-10-16 UI-14). the counts kept on this device: the same table, at the end.
   a column is as wide as the longest name (game.js --name-length, in letters) + the picture and "2 / 3" (4.5em), so
   no name is folded: as many columns as fit (the evening of 10/16: "ヘリウムボイ／ス" in 3 columns of 10.5em) */
.method-counts {
    list-style: none;
    margin: 2px 0 0;
    /* (the right: the numbers are not under the scrollbar of a phone) */
    padding: 0 8px 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, calc(var(--name-length, 6) * 1em + 4.5em)), 1fr));
    gap: 0 16px;
    font-size: 14px;
}

/* folded into one line on a phone ("ぴったり 3 / 8回"): a press opens the table (game.js addMethodCountBox) */
.method-count-summary {
    display: list-item;
    align-content: center;
    font-size: 14px;
    cursor: pointer;
}

.method-count {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px dashed var(--rule);
    padding: 1px 0;
}

.method-count-name {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

/* (only a phone narrower than a name has to cut it, with "…") */
.method-count-label {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.method-count-number {
    flex-shrink: 0;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}

.method-count.is-passed .method-count-number {
    color: var(--red);
}

/* ---------- the page of the rules (terms.html): a long page that scrolls ---------- */

body.doc-page {
    height: auto;
    min-height: 100dvh;
    display: block;
    overflow: auto;
    max-width: 720px;
}

.doc-page h1 {
    font-size: 19px;
    color: var(--ink);
}

/* the ruled lines are as far apart as the lines of the text (27px), and everything on the page is a whole number
   of lines tall (the headings, the note "下書き" and the gaps), so every line of words sits on a ruled line.
   2026-10-16 UI-26: the headings were 30.6px tall with gaps of 18px and 4px, and from the first heading on the
   lines went through the words. (line-height in px: every part inherits the same 27px, whatever its letter size.
   background-origin content-box: the first ruled line is under the first line of words, not 12px above it) */
.doc-card {
    display: block;
    margin-top: 8px;
    padding: 12px 16px;
    line-height: 27px;
    font-size: 15px;
    font-weight: 400;
    background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 26px, var(--rule) 26px, var(--rule) 27px);
    background-origin: content-box;
    background-repeat: repeat-x;
}

/* a heading: one empty line above it, then its own line (fit-content: the marker is only as long as the words) */
.doc-card h2 {
    width: fit-content;
    margin: 27px 0 0;
    font-size: 17px;
    font-weight: 600;
    background: linear-gradient(transparent 50%, var(--marker-blue) 50%);
}

.doc-card ul,
.doc-card ol {
    margin: 0;
    padding-left: 22px;
}

/* (one line of the page for each line of its words: no padding above and under) */
.doc-draft {
    background: var(--sticky-pink);
    box-shadow: 1px 2px 0 var(--shadow);
    padding: 0 10px;
    font-size: 13px;
}

.doc-back {
    margin-top: 27px;
    text-align: center;
}

.doc-card a {
    color: var(--blue-pen);
}

/* (2026-10-20 the terms page in parts: articles, questions and a list of contents. each is a whole number of lines
   tall like the rest, so the words stay on the ruled lines)
   an article (第1条…) or a part of a section: one empty line above it, in the letters of the text, but thick */
.doc-card h3 {
    margin: 27px 0 0;
    font-size: 15px;
    font-weight: 600;
}

/* a question of the FAQ: the question is a line that opens its answer (details: the browser opens and closes it,
   no script). the answer is set in by one letter, under its question */
.doc-card summary {
    cursor: pointer;
    font-weight: 600;
}

.doc-card details > :not(summary) {
    margin-left: 1em;
}

/* a jump from the list of contents lands with the heading a little under the top, not cut by it */
.doc-card [id] {
    scroll-margin-top: 8px;
}

/* ---------- a wide screen (a computer): a classroom. the lobby: the board and the attendance book on the left,
   the sticky note on the right / play and results: the board on top, the desk below ---------- */

@media (min-width: 900px) {
    body {
        max-width: 1200px;
        padding: 12px 32px 20px;
        gap: 12px;
    }

    h1 {
        font-size: 16px;
    }

    .screen {
        gap: 16px;
    }

    .board-frame {
        padding: 10px 10px 14px;
    }

    .board {
        padding: 16px 26px;
    }

    /* lobby: on the left the class: the board, the attendance book (出席簿) and "始める" under it
       (when everyone is here, the host starts). on the right the rules: a sticky note as tall as the screen,
       about 4 tenths of the width (2026-10-09 pineさん "決まりを決めるの割合をもう少し大きく": 5fr and 4fr share the
       width 5 to 4, and the note is never narrower than 380px).
       (nothing scrolls on a computer screen 560px tall, with 8 people) */
    .lobby-screen {
        display: grid;
        grid-template-columns: minmax(0, 5fr) minmax(380px, 4fr);
        grid-template-rows: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "board settings"
            "work settings"
            "start settings";
        gap: 14px 26px;
    }

    /* no start button (not the host, or watching a game): no empty row under the attendance book */
    .lobby-screen:has(.start-button[hidden]) {
        grid-template-rows: auto minmax(0, 1fr);
        grid-template-areas:
            "board settings"
            "work settings";
    }

    .lobby-screen > .board-frame {
        grid-area: board;
    }

    /* the page has no box of its own here: its 3 parts (the rules, the attendance book, start) go into the grid above
       (display: contents = "as if this box were not there, but its children are") */
    .lobby-paper {
        display: contents;
    }

    /* the board: the title and the room code, the buttons at the right end; the host and a note under them */
    .lobby-board {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "head buttons"
            "host host"
            "note note";
        gap: 6px 16px;
    }

    /* (flex-wrap: if the title and the room code do not fit, the code goes under the title, never under the buttons) */
    .lobby-board .board-head {
        grid-area: head;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 2px 20px;
    }

    .lobby-board .room-buttons {
        grid-area: buttons;
        justify-content: flex-end;
        align-self: start;
    }

    .lobby-board .host-row {
        grid-area: host;
    }

    .lobby-board .host-note {
        grid-area: note;
    }

    /* the rules are on the sticky note on a computer, for everyone */
    .lobby-board .rule-summary {
        display: none;
    }

    /* (nowrap: the title and "合言葉" never break into short pieces when the board is narrow) */
    .board-title {
        font-size: 24px;
        white-space: nowrap;
    }

    .room-label {
        white-space: nowrap;
    }

    .room-code {
        font-size: 20px;
    }

    .host-row {
        font-size: 18px;
    }

    .host-note {
        font-size: 14px;
    }

    .lobby-board .chalk-button {
        font-size: 13px;
        padding: 4px 12px;
    }

    /* "部屋を出る": a little away from the other two, so it is not pressed by mistake */
    .lobby-board .leave-room-button {
        margin-left: 14px;
    }

    /* the sticky note with the rules: the host can press them, everyone else only sees them */
    .lobby-settings,
    .lobby-screen:not(.is-host) .lobby-settings {
        grid-area: settings;
        display: flex;
        gap: 10px;
        min-height: 0;
        overflow-y: auto;
        background: var(--sticky-yellow);
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
        padding: 16px 18px;
    }

    .settings-head {
        display: flex;
    }

    /* (one line: with "待っている人をクラスにもどす" beside it, a long title is cut with "…", so the note never gets longer) */
    .settings-title {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .setting-label {
        font-size: 13px;
        width: 6em;
    }

    .picker-name {
        font-size: 14px;
        padding: 5px 0;
    }

    .lobby-work {
        grid-area: work;
        min-height: 0;
        overflow-y: auto;
        gap: 10px;
        padding: 16px 24px;
        background-color: var(--paper);
        border: 1px solid var(--paper-edge);
        border-radius: 6px;
        box-shadow: 0 6px 14px rgba(45, 51, 64, 0.18);
    }

    .roll-title {
        font-size: 18px;
    }

    /* a column is at most 360px wide, so with 1〜4 people the armband and 外す stay near the name */
    .roll-list {
        grid-auto-columns: minmax(0, 360px);
    }

    .roll-line {
        min-height: 34px;
        font-size: 17px;
    }

    .roll-number {
        font-size: 13px;
    }

    /* the way to sit down: the boxes are not as wide as the page */
    .sit-row {
        max-width: 560px;
    }

    .lobby-work .sub-row {
        justify-content: flex-end;
    }

    /* 学級委員を代わる: at the right end too, not as wide as the attendance book */
    .lobby-work .host-box {
        justify-content: flex-end;
    }

    .lobby-work .host-box select {
        flex: 0 1 240px;
    }

    /* start: under the attendance book (only the host sees it) */
    .start-button {
        grid-area: start;
        position: static;
        font-size: 20px;
        padding: 10px 24px;
    }

    /* play: the board on top (3 parts: where we are / what came); めあて, the time and how many have finished on the
       left; making on the right. (the left was 300px with めあて on a sticky note and the list of the names: 2026-10-17
       pineさん, both were not needed, so the page has the width) */
    .play-screen {
        display: grid;
        grid-template-columns: 220px minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
        grid-template-areas:
            "board board"
            "side work";
        gap: 18px 26px;
    }

    /* a computer screen is tall enough, and scrolling here would cut off the shadow of the page */
    .play-screen {
        overflow: visible;
    }

    .play-screen > .board-frame {
        grid-area: board;
    }

    .play-side {
        grid-area: side;
        display: flex;
        flex-direction: column;
        gap: 16px;
        min-height: 0;
        overflow-y: auto;
        /* room for the shadow of the sticky note */
        padding: 0 4px 6px 0;
    }

    .play-side > * {
        order: 0;
    }

    .play-work {
        grid-area: work;
        order: 0;
        padding: 18px 26px;
        background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 35px, var(--rule) 35px, var(--rule) 36px);
        box-shadow: 0 6px 14px rgba(45, 51, 64, 0.18);
    }

    .play-screen:has(.aim-box:not([hidden])) .play-work {
        border-radius: 6px;
    }

    .play-board {
        display: grid;
        grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr);
        grid-template-rows: auto auto 1fr;
        grid-template-areas:
            "head main"
            "steps main"
            "role main";
        gap: 12px 24px;
        min-height: 210px;
        box-sizing: border-box;
    }

    .play-board .board-head {
        grid-area: head;
        flex-direction: column;
        gap: 6px;
        padding-right: 0;
    }

    .play-board .step-strip {
        grid-area: steps;
    }

    .play-board .role-title {
        grid-area: role;
        font-size: 14px;
    }

    .play-board .received-box {
        grid-area: main;
        align-self: center;
        justify-self: center;
        align-items: center;
        text-align: center;
        padding: 6px 24px 8px;
    }

    /* with the sticky note "終わらせる / やめる" at the top right: room for it on both sides, so the frame stays in the middle */
    .play-board:has(.end-button:not([hidden])) .received-box {
        margin-inline: 90px;
    }

    .play-board.is-start .role-title {
        grid-area: main;
        align-self: center;
        text-align: center;
        font-size: 16px;
    }

    .play-board.is-start .role-name {
        font-size: 44px;
        margin-bottom: 6px;
    }

    .round-title {
        font-size: 18px;
    }

    .mode-tag {
        font-size: 14px;
    }

    .step-strip {
        font-size: 16px;
    }

    .step-strip .is-now {
        font-size: 19px;
        padding: 2px 14px;
    }

    .received-label {
        font-size: 17px;
    }

    .received-message {
        font-size: 52px;
    }

    .received-message.is-short-text {
        font-size: 64px;
    }

    .received-message.is-long-text {
        font-size: 28px;
    }

    .received-canvas {
        width: min(100%, 30vh);
    }

    .play-board .received-stage {
        justify-content: center;
    }

    /* a guess round where a drawing came (UI-2: 139px at 1280×580): the page and the side take only the height they
       need, the blackboard takes the rest, and the frame of what came fills the right part of the board.
       (the drawing may get smaller than its smallest size on a phone: never over the page under it) */
    .play-screen.is-guessing-picture {
        grid-template-rows: minmax(0, 1fr) auto;
    }

    .play-screen.is-guessing-picture .play-board {
        height: 100%;
    }

    .play-screen.is-guessing-picture .play-board .received-box {
        align-self: stretch;
        justify-self: stretch;
        min-height: 0;
    }

    .play-screen.is-guessing-picture .received-stage {
        min-height: 0;
    }

    .received-message .pictogram {
        width: 64px;
        height: 64px;
    }

    .received-message .swatch {
        width: 52px;
        height: 52px;
    }

    /* めあて: just the line of the way and its rule, on the desk (no sticky note, no heading: 2026-10-17 pineさん) */
    .aim-box {
        gap: 6px;
        background: none;
        border: none;
        border-radius: 0;
        margin: 0;
        padding: 0;
    }

    .method-rule {
        font-size: 15px;
    }

    .hint-box {
        font-size: 14px;
    }

    .timer-box {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .timer-text {
        font-size: 13px;
        color: var(--ink-soft);
    }

    .ruler {
        flex: none;
        height: 28px;
        background-size: 100% 6px, 100% 11px;
    }

    .ruler-marker {
        top: 12px;
    }

    /* how many have finished: a little bigger (the names to skip go one under another in the narrow column) */
    .status-row {
        gap: 6px 10px;
        padding: 0;
        font-size: 16px;
    }

    .wait-me-note {
        font-size: 15px;
    }

    .away-note {
        font-size: 13px;
    }

    /* (the names side by side as long as they fit in the column, small: with 8 people one under another they went
       under the bottom of the column on a short screen. 2026-10-17 review) */
    .skip-list {
        gap: 4px 6px;
    }

    .skip-lead {
        flex-basis: 100%;
    }

    .skip-list button {
        padding: 2px 9px;
    }

    .palette-box button {
        min-width: 52px;
        height: 52px;
        font-size: 24px;
    }

    /* the drawing board on a computer, like a design tool: the tools on the left, the board in the middle,
       the colors, the count and 送る on the right. the box of the way and the drawing area give their parts
       to the grid of the page (display: contents = "as if this box were not there, but its children are"),
       so 送る (outside the drawing area) can stand under the colors, and the board gets the whole height */
    .play-work:has(> .method-box:not([hidden]) > .draw-area:not([hidden])) {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) 176px;
        grid-template-rows: auto auto minmax(0, 1fr) auto;
        grid-template-areas:
            "topic topic topic"
            "tools stage colors"
            "tools stage count"
            "tools stage bottom";
        column-gap: 20px;
        row-gap: 0;
    }

    .play-work:has(> .method-box:not([hidden]) > .draw-area:not([hidden])) > .method-box,
    .method-box > .draw-area {
        display: contents;
    }

    .play-work:has(> .method-box:not([hidden]) > .draw-area:not([hidden])) > .bottom-row {
        grid-area: bottom;
        flex-direction: column;
        align-items: stretch;
        margin-top: 10px;
    }

    .play-work:has(> .method-box:not([hidden]) > .draw-area:not([hidden])) .send-button {
        align-self: stretch;
        padding: 9px 0;
    }

    .draw-topic {
        margin-bottom: 10px;
        font-size: 18px;
    }

    /* the tools: buttons with their names (a computer has the room). (4px: with 5px they were 268px in 266px at
       1240×500 with 小さく, and the column scrolled. 2026-10-17 review) */
    .draw-tools {
        gap: 4px;
        align-self: start;
        max-height: 100%;
    }

    .tool-button {
        justify-content: flex-start;
        width: auto;
        min-width: 112px;
        height: 34px;
        padding: 0 12px 0 10px;
    }

    .tool-name {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip: auto;
    }

    /* the widths: 4 dots side by side, as wide as the other tools */
    .width-box {
        flex-direction: row;
        justify-content: space-between;
    }

    .width-button {
        width: 26px;
        height: 30px;
    }

    .draw-stage {
        align-items: center;
    }

    /* the colors: 4 in a line */
    .color-box {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        justify-items: center;
        gap: 9px 6px;
        margin-bottom: 12px;
        align-self: start;
    }

    .color-button {
        width: 30px;
        height: 30px;
    }

    /* (contain: the count never makes the column of the tools wider: why a shape disappeared is a long line, and it
       pushed the board from 598px down to 105px at 1280×800. it folds in the column instead) */
    .draw-count {
        margin-top: 0;
        text-align: left;
        line-height: 1.6;
        contain: inline-size;
    }

    /* 広げる: only the blackboard is put away (its row too). the left side stays: めあて, the time,
       and the names with the host's buttons to skip someone (the height is what the board needed, not the width) */
    .play-screen.is-big-drawing {
        grid-template-rows: minmax(0, 1fr);
        grid-template-areas: "side work";
    }

    .send-button {
        flex: none;
        align-self: flex-end;
        padding: 9px 40px;
        font-size: 20px;
    }

    .play-work .bottom-row {
        justify-content: flex-end;
    }

    /* word rounds (the topic and 当てる): the box in the middle of the page, written big,
       like writing the title on a new page (the page had a lot of empty space under a small box) */
    .word-box {
        flex: 1;
        justify-content: center;
        align-items: stretch;
        align-self: center;
        gap: 16px;
        width: 100%;
        max-width: 620px;
    }

    .word-input {
        font-size: 30px;
        padding: 14px 20px;
        text-align: center;
    }

    /* the warning about letters that cannot be used keeps its line even when hidden, so the box does not jump up and down while typing */
    .word-warning {
        text-align: center;
    }

    .word-box .word-warning[hidden] {
        display: block !important;
        visibility: hidden;
    }

    .topic-buttons {
        justify-content: center;
        gap: 16px;
    }

    .topic-buttons .sub-button {
        font-size: 16px;
        padding: 8px 22px;
    }

    /* results: the board on top, the page below */
    .result-board {
        padding: 20px 26px;
    }

    .result-title {
        font-size: 40px;
    }

    .result-sub {
        font-size: 17px;
    }

    .result-paper {
        padding: 18px 40px;
        background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 35px, var(--rule) 35px, var(--rule) 36px);
        box-shadow: 0 6px 14px rgba(45, 51, 64, 0.18);
    }

    .result-head {
        font-size: 14px;
    }

    .result-text {
        font-size: 28px;
    }

    .result-text.is-sent {
        font-size: 24px;
    }

    .result-list.is-summary .result-text {
        font-size: 19px;
    }

    /* all the chains at once: the chains stand side by side, so the list is shorter
       (auto-fit: 3 chains share the whole width; 8 chains make 2 rows of 4) */
    .result-list.is-summary {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        align-content: start;
        align-items: start;
        gap: 12px 24px;
    }

    .result-canvas {
        width: 140px;
    }

    .solo-result-note {
        font-size: 14px;
    }

    /* ◀ 1行もどる and 止める on the left, the buttons that go on to the next part on the right */
    .result-paper .pause-button {
        margin-right: auto;
    }

    .compare-words {
        font-size: 38px;
    }

    .result-compare:not(.is-small) .compare-line.is-answer .compare-words {
        font-size: 46px;
    }

    .result-compare.is-held .compare-line.is-answer .compare-label {
        font-size: 22px;
    }

    .compare-label {
        font-size: 15px;
    }

    .compare-hanamaru {
        width: 84px;
        height: 84px;
    }

    .result-compare.is-perfect .compare-line.is-answer {
        padding-right: 82px;
    }

    .result-compare.is-small .compare-words {
        font-size: 19px;
    }

    .result-list.is-summary .result-stats {
        grid-column: 1 / -1;
    }

    .result-paper .bottom-row {
        justify-content: flex-end;
    }

    .next-button,
    .new-game-button {
        flex: none;
        padding: 9px 36px;
    }
}

/* ---------- a narrow computer (900〜1239px, or a window half the width of a big screen): on the board,
   the buttons go under the title (next to it, the title and the room code would be squeezed) ---------- */

@media (min-width: 900px) and (max-width: 1239px) {
    .lobby-board {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "head"
            "buttons"
            "host"
            "note";
    }

    .lobby-board .room-buttons {
        justify-content: flex-start;
    }

    /* the drawing board: the tools show only their pictures, and the colors are narrower, so the board stays big */
    .play-work:has(> .method-box:not([hidden]) > .draw-area:not([hidden])) {
        grid-template-columns: auto minmax(0, 1fr) 140px;
        column-gap: 14px;
    }

    /* (2 columns, like a phone: 10 buttons in 5 lines) */
    .draw-tools {
        display: grid;
        grid-template-columns: repeat(2, 34px);
        align-content: start;
    }

    .width-box {
        display: contents;
    }

    .tool-button {
        justify-content: center;
        width: 34px;
        min-width: 0;
        height: 30px;
        padding: 0;
    }

    .tool-name {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .width-button {
        width: 34px;
        height: 30px;
    }

    .color-box {
        gap: 7px 4px;
    }

    .color-button {
        width: 26px;
        height: 26px;
    }

    /* 広げる here: the height is free now, but the width is short. so the colors and the count go under
       the tools (one column on the left), and the board gets the width (measured at 1000×600: 338px → 4〜500px).
       送る is under the board at its right end, like on every other screen (2026-10-16 UI-19: it was under the tools) */
    .play-screen.is-big-drawing .play-work:has(> .method-box:not([hidden]) > .draw-area:not([hidden])) {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-rows: auto auto auto minmax(0, 1fr) auto;
        grid-template-areas:
            "topic topic"
            "tools stage"
            "colors stage"
            "count stage"
            ". bottom";
    }

    .play-screen.is-big-drawing .play-work:has(> .method-box:not([hidden]) > .draw-area:not([hidden])) > .bottom-row {
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
    }

    .play-screen.is-big-drawing .play-work:has(> .method-box:not([hidden]) > .draw-area:not([hidden])) .send-button {
        padding: 9px 40px;
    }
}

/* ---------- a computer with a tall screen (the lobby) ---------- */

@media (min-width: 900px) and (min-height: 761px) {
    /* (the lobby: the frame of the preview has room, so its chips are bigger) */
    .mode-chip {
        padding: 2px 10px 2px 7px;
        font-size: 16px;
        line-height: 24px;
    }

    .mode-chip .line-icon {
        width: 18px;
        height: 18px;
    }

    .chip-row-label {
        font-size: 14px;
        line-height: 30px;
    }

    .mode-chips {
        gap: 9px;
    }
}

/* ---------- a computer with a very tall screen: there, the drawing board (小さく, with the blackboard) is limited by
   the width, not the height. so the colors, the count and 送る go under the tools, in one column on the left, and the
   board gets the rest (measured at 1920×1080: with a column on each side the board was 424px, the old board was about
   620px). (from 900px tall: it was from 761px, and at 1280×800 and 1366×768 the board is limited by the height, so the
   column on the left was too long: the tools scrolled and the colors lay over them. 2026-10-17 review) ---------- */

@media (min-width: 900px) and (min-height: 900px) {
    /* (送る is under the board at its right end, like on every other screen: 2026-10-16 UI-19, it was under the tools.
       the board is limited by the width here, so the line of 送る takes no height from it) */
    .play-work:has(> .method-box:not([hidden]) > .draw-area:not([hidden])) {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-rows: auto auto auto minmax(0, 1fr) auto;
        grid-template-areas:
            "topic topic"
            "tools stage"
            "colors stage"
            "count stage"
            ". bottom";
    }

    .draw-tools {
        margin-bottom: 14px;
    }

    .play-work:has(> .method-box:not([hidden]) > .draw-area:not([hidden])) > .bottom-row {
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
    }

    .play-work:has(> .method-box:not([hidden]) > .draw-area:not([hidden])) .send-button {
        padding: 9px 40px;
    }
}

/* ---------- a very narrow phone (under 360px): the 3 chalk buttons stay in one line ---------- */

@media (max-width: 359px) {
    .room-buttons .chalk-button {
        padding: 3px 7px;
    }

    /* the cards of the settings: the longest choices fit */
    .picker-name {
        font-size: 11px;
    }
}

/* ---------- a phone: the attendance book first (the class screen; the rules are on the second screen),
   so who is here and "席に着く" are always seen first ---------- */

@media (max-width: 899px) {
    .lobby-work {
        order: -1;
    }

    /* the lobby on a phone is 2 screens, one after the other (2026-10-09 pineさん):
       ① the class screen: people gather, and the host presses 始める. the rules are not shown here
       ② the rules screen (is-rules-stage): the host chooses the rules; everyone sitting waits and sees them change.
       (someone who comes now and is not sitting yet also sees the attendance book, to sit down) */
    .lobby-screen:not(.is-rules-stage) .lobby-settings {
        display: none;
    }

    /* (it grows down to the start button, so the frame of the preview fills the page) */
    .lobby-screen.is-rules-stage .lobby-settings {
        display: flex;
        flex: 1 0 auto;
    }

    .lobby-screen.is-rules-stage.is-seated .lobby-work {
        display: none;
    }

    .lobby-screen.is-rules-stage .settings-head {
        display: flex;
    }

    /* the chips of the preview a little smaller on a phone, so the rules screen fits without scrolling.
       (the rows are 44px apart, so their 44px triangles never take the same place: 2026-10-16 UI-10, and the slip
       伝え方一覧 is away from the ◀ of the mode above it: it was 3px under it) */
    .lobby-settings {
        gap: 10px;
    }

    .mode-preview {
        margin-top: 16px;
        padding: 18px 8px 8px;
    }

    .mode-chips {
        gap: 8px;
    }

    .mode-chip {
        padding: 0 6px 0 4px;
        font-size: 13px;
        line-height: 20px;
    }

    .mode-chip .line-icon {
        width: 15px;
        height: 15px;
    }

    .chip-row-label {
        font-size: 12px;
        line-height: 22px;
    }

    /* the waiting screen (everyone but the host): "学級委員が決まりを決めています" on a yellow sticky note */
    .lobby-screen.is-rules-stage:not(.is-host) .settings-title {
        padding: 8px 10px;
        font-size: 15px;
        color: var(--ink);
        background: var(--sticky-yellow);
        box-shadow: 1px 2px 0 var(--shadow);
    }

    /* the rules are on the page now: not on the board too */
    .lobby-screen.is-rules-stage .rule-summary {
        display: none;
    }

    /* the page goes on under "始める" (game.js showMoreBelow, 2026-10-16 UI-23: at 360×640 the last row of the
       preview was under it, with no sign): the page fades into the button, and a small arrow points down.
       (the lines are only pictures: a tap goes through them) */
    .lobby-paper.has-more-below .start-button::before,
    .lobby-paper.has-more-below .start-button::after {
        content: "";
        position: absolute;
        pointer-events: none;
    }

    .lobby-paper.has-more-below .start-button::before {
        left: -12px;
        right: -12px;
        bottom: 100%;
        height: 28px;
        background: linear-gradient(to bottom, transparent, var(--paper) 85%);
    }

    .lobby-paper.has-more-below .start-button::after {
        left: 50%;
        bottom: calc(100% + 8px);
        width: 9px;
        height: 9px;
        border-right: 2px solid var(--ink-soft);
        border-bottom: 2px solid var(--ink-soft);
        transform: translateX(-50%) rotate(45deg);
    }

    /* the tools of the drawing board on a phone: 2 columns (10 buttons in 5 lines), so they fit beside the board.
       the 4 widths join the grid as buttons of their own (display: contents) */
    .draw-tools {
        display: grid;
        grid-template-columns: repeat(2, 34px);
        align-content: start;
    }

    .width-box {
        display: contents;
    }
}

/* (広げる on a phone held sideways: the tools stay beside the board. めあて and the names are put away: see the part
   for a screen held sideways at the end) */

/* ---------- 広げる on a phone held upright: the screen is tall enough, so the tools go in a line above the board
   (a column on the left would take its width) and the page has thinner edges: the board is as wide as the screen ---------- */

@media (max-width: 899px) and (min-height: 500px) {
    .play-screen.is-big-drawing .play-work {
        padding: 6px 8px 8px;
    }

    .play-screen.is-big-drawing .draw-area {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto auto minmax(0, 1fr) auto;
        grid-template-areas:
            "topic"
            "tools"
            "colors"
            "stage"
            "count";
    }

    .play-screen.is-big-drawing .draw-tools {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        margin-bottom: 6px;
        overflow: visible;
    }

    /* the 8 buttons share the whole line (the widths and the colors are one button each now: 2026-10-13),
       so each is about 40px (it was 30px, with 4 widths of 26px and a row of 12 colors under them).
       the name of each tool is under its picture (2026-10-16 UI-11: only the pictures were there, so each tool was
       found by trying it) */
    .play-screen.is-big-drawing .draw-tools .tool-button {
        flex: 1 1 0;
        flex-direction: column;
        gap: 3px;
        width: auto;
        min-width: 0;
        height: 50px;
    }

    .play-screen.is-big-drawing .tool-button .line-icon {
        width: 21px;
        height: 21px;
    }

    /* (on a narrow phone a name of 4 letters folds into 2 lines at its <wbr> in index.html: 1つ／消す.
       a name with no <wbr> never folds: it was "小さ／く" at 320px, below) */
    .play-screen.is-big-drawing .tool-name {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip: auto;
        white-space: normal;
        word-break: keep-all;
        text-align: center;
        font-size: var(--text-tool);
        font-weight: 400;
        line-height: 1;
        letter-spacing: -0.04em;
    }

    .play-screen.is-big-drawing .tool-name:not(:has(wbr)) {
        white-space: nowrap;
    }

    .play-screen.is-big-drawing .width-button {
        width: 26px;
    }

    /* (the strip of what came is just above the tools: a little more room under it, so its やめる is not pressed
       when a tool is meant. 2026-10-16 UI-10) */
    .play-screen.is-big-drawing .draw-topic {
        margin-bottom: 12px;
    }

    /* a way made on the page (2026-10-16 UI-1 a palette way, pineさん "黒板じゃなくて付箋にして細く". 10/17
       q-band-others: ケータイ打ち, the typing ways and the voices too): while I make it, the blackboard is put away and
       what came is on a thin yellow sticky note in its place (game.js is-band-making), so what I make gets the height */
    .play-screen.is-band-making > .board-frame {
        display: none;
    }

    .play-screen.is-band-making .received-note {
        display: flex;
    }

    /* the topic round (2026-10-18 pineさん "画面いっぱい使いたい／お題を描くところをもう少し太く／簡単なお題、難しいお題を
       縦に2つ並べる"): a thicker box at the top (the keyboard comes from the bottom), and the 2 topic buttons one under
       the other in the middle of the space under it, instead of one block of space over 送る */
    .play-work:has(.topic-buttons:not([hidden])) .word-box {
        flex: 1 0 auto;
        align-items: stretch;
        gap: 16px;
    }

    /* (the guess rounds get the thicker box too: it stays at the top, where the keyboard cannot hide it) */
    .play-work .word-box .word-input {
        min-height: 64px;
        font-size: 22px;
        text-align: center;
    }

    .play-work .topic-buttons:not([hidden]) {
        flex-direction: column;
        gap: 16px;
        margin-block: auto;
    }

    .play-work .topic-buttons .sub-button {
        width: 100%;
        min-height: 56px;
        font-size: 16px;
    }

    /* waiting (pineさん "コラムの欄がもっと広くていい／罫線にあわせて情報をかけば枠がいらない／ノートに板書してあるみたい
       に"): no box; everything is a multiple of the page's 32px lines, so the words sit on the ruled lines, and the
       column shows up to 7 lines before つづき */
    .play-work:has(> .trivia-box:not([hidden])) {
        padding-top: 0;
        gap: 0;
    }

    .play-work > .waiting-message {
        line-height: 32px;
        padding: 16px 8px;
        margin: 0;
    }

    .play-work > .trivia-box {
        background: none;
        border: none;
        border-radius: 0;
        padding: 0 4px;
        font-size: 15px;
        line-height: 32px;
    }

    .play-work > .trivia-box .trivia-title {
        height: 32px;
    }

    /* (5 lines, and the doodle takes what is left: with a waiting note of 3 or 4 lines (long names, a skipped turn)
       7 lines and a 96px doodle went under the bottom of the screen. 2026-10-18 review) */
    .play-work > .trivia-box .trivia-text {
        -webkit-line-clamp: 5;
    }

    .play-work > .trivia-box.is-open .trivia-text {
        max-height: calc(32px * 7);
    }

    .play-work > .doodle-area {
        min-height: 32px;
    }
}

/* (a short phone: 3 lines of the column, so nothing scrolls. measured at 360×640: 4 lines scrolled 16px) */
@media (max-width: 899px) and (min-height: 500px) and (max-height: 700px) {
    .play-work > .trivia-box .trivia-text {
        -webkit-line-clamp: 3;
    }

    .play-work > .trivia-box.is-open .trivia-text {
        max-height: calc(32px * 3);
    }

    .play-work > .doodle-area {
        min-height: 32px;
    }
}

/* drawing on a phone: always big (pineさん "常に絵は広げた状態でいい"). 小さく is there only when what came cannot be written on
   the strip (a drawing, a voice, 鏡文字 …: only after a skipped turn passed it on), to see it on the blackboard
   (game.js is-plain-came) */
@media (max-width: 899px) {
    .play-screen.is-big-drawing.is-plain-came .draw-expand-button {
        display: none;
    }
}

/* ---------- a short phone held upright (360×640, 375×667, 320×568), while drawing big (2026-10-16 UI-5: with 8 people
   and a topic of 40 letters the board was 179px at 360×640). 2026-10-17 pineさん "途中経過をなくしてお題を表示する":
   めあて and how many have finished are put away, and the strip of what came stays over the tools, with やめる / 終わらせる
   at its right end as on the other screens (q-end-in-note), like a screen held sideways. the strip is thin, and the
   page gives its sides to the board ---------- */

@media (max-width: 899px) and (min-height: 500px) and (max-height: 700px) {
    .play-screen.is-big-drawing .aim-box,
    .play-screen.is-big-drawing .status-row {
        display: none;
    }

    .play-screen.is-big-drawing .play-work {
        border-radius: 6px;
        padding-inline: 4px;
    }

    .play-screen.is-big-drawing .draw-topic {
        padding: 2px 8px;
        border-width: 2px;
        line-height: 1.3;
    }
}

/* ---------- a short phone (700px tall or less, held either way): when the screen is too short for everything and
   scrolls, the line of えらびなおす and 送る stays at the bottom of the screen (2026-10-16 UI-6: at 320×568 送る was
   71〜91px under the bottom, and nothing showed that the screen scrolls). the paper under it hides what goes under ---------- */

@media (max-width: 899px) and (max-height: 700px) {
    .play-work > .bottom-row {
        position: sticky;
        bottom: 0;
        z-index: 2;
        padding-top: 6px;
        background: var(--paper);
    }

    /* the line is about 53px tall: the screen keeps this much at its bottom for what it scrolls to (a box I tap, which
       game.js also brings to the middle). at the end of the scroll the line is in its own place, under everything */
    .play-screen {
        scroll-padding-bottom: 64px;
    }

    /* a voice way is never cut shorter than its buttons and its line of words: the page grows, and the end of the
       scroll shows all of it above 送る (逆再生まねボイス at 320×568: its last line was 12px under 送る even there) */
    .method-box:has(> .voice-area:not([hidden])) {
        min-height: auto;
    }

    /* a guess round where a drawing came: the drawing may get smaller than 140px (down to 80px, it is made big with a
       tap), so the answer box is above 送る from the start (at 320×568 it was 32px under it) */
    .play-screen.is-guessing-picture .received-stage {
        min-height: 80px;
    }
}

/* ---------- a phone: the buttons pressed while playing are at least 44px tall, the size a finger needs (2026-10-16
   UI-10: many were 21〜31px, and やめる or 1つ消す was pressed by mistake). the triangles of the rules are 44px
   squares (margin-block: their row stays as tall as its card; the rows are 44px apart, see .lobby-settings).
   the results too (the evening of 10/16: 1行もどる, 止める, 答えまでとばす, もう一度見る, 全部を見る, 入口へ / 部屋を出る and
   聞く were 31px, side by side). the chips of the preview of the mode are smaller, 36px (8px apart: .mode-chips),
   or the rules screen would be twice as long ---------- */

@media (max-width: 899px) {
    .end-sticky,
    .rechoose-button,
    .undo-button,
    .topic-buttons .sub-button,
    .guide-row .sub-button,
    .preview-button,
    .class-back-button,
    .entrance-screen .join-button,
    .result-paper .bottom-row button,
    .result-list .sub-button,
    .method-count-summary {
        min-height: 44px;
    }

    .mode-chip {
        min-height: 36px;
    }

    .triangle-button {
        width: 44px;
        height: 44px;
        margin-block: -8px;
    }
}

/* ---------- a computer with a short screen (a laptop, or a screen zoomed to 150%): the same layout, but tighter,
   so the page for making gets the height. (measured at 1280×580: the play board took 4 tenths of the screen,
   the drawing board was 137px, and the lobby page hid "部屋を出る" under the page) ---------- */

@media (min-width: 900px) and (max-height: 760px) {
    body {
        padding: 8px 28px 10px;
        gap: 8px;
    }

    .screen {
        gap: 10px;
    }

    .board-frame {
        padding: 8px 8px 12px;
    }

    .board {
        padding: 10px 20px;
    }

    /* lobby */
    .lobby-screen {
        gap: 10px 20px;
    }

    /* (measured at 1280×560 in a real room, with the lock and the preview of the mode: this fits with no scroll) */
    .lobby-settings,
    .lobby-screen:not(.is-host) .lobby-settings {
        gap: 5px;
        padding: 12px 16px;
    }

    .picker-name {
        padding: 2px 0;
    }

    .lobby-work {
        gap: 8px;
        padding: 12px 20px;
    }

    .roll-line {
        min-height: 30px;
        font-size: 16px;
    }

    .start-button {
        padding: 7px 24px;
    }

    /* play: a shorter board, and smaller gaps under it */
    .play-screen {
        gap: 10px 20px;
    }

    .play-board {
        min-height: 0;
        gap: 6px 20px;
    }

    .round-title {
        font-size: 16px;
    }

    .step-strip {
        font-size: 14px;
    }

    .step-strip .is-now {
        font-size: 16px;
        padding: 1px 10px;
    }

    .received-message {
        font-size: 40px;
    }

    .received-message.is-short-text {
        font-size: 48px;
    }

    .received-message.is-long-text {
        font-size: 22px;
    }

    .received-canvas {
        width: min(100%, 24vh);
    }

    .play-board.is-start .role-name {
        font-size: 32px;
        margin-bottom: 2px;
    }

    .play-side {
        gap: 10px;
    }

    .aim-box {
        gap: 4px;
    }

    .method-rule {
        font-size: 15px;
    }

    .status-row {
        font-size: 15px;
    }

    .play-work {
        padding: 12px 20px;
    }

    /* results */
    .result-board {
        padding: 12px 20px;
    }

    .result-title {
        font-size: 30px;
    }

    .result-paper {
        padding: 12px 28px;
    }
}

/* ---------- a narrow AND short computer (for example 900〜1239 × 560): the lobby a little tighter still.
   the sticky note is narrower there, so the preview takes more lines, and in the attendance book a name and
   the armband take 2 lines (measured at 900×560: the note was 2px too long, the attendance book 16px) ---------- */

@media (min-width: 900px) and (max-width: 1239px) and (max-height: 760px) {
    .lobby-settings,
    .lobby-screen:not(.is-host) .lobby-settings {
        gap: 4px;
    }

    .lobby-work {
        gap: 4px;
    }

    .roll-line {
        min-height: 28px;
    }

    /* the chips of the preview a little smaller (the note is only 380〜440px wide here) */
    .mode-chip {
        gap: 3px;
        padding: 0 6px 0 4px;
        font-size: 12px;
        line-height: 20px;
    }

    .mode-chip .line-icon {
        width: 14px;
        height: 14px;
    }

    .chip-row-label {
        width: 2.6em;
        font-size: 11px;
        line-height: 22px;
    }
}

/* ---------- a screen held sideways and less than 500px tall (a phone held sideways: 740×360, 667×375, 844×390, and
   932×430, which is as wide as a computer; also a computer zoomed in a lot): like a computer, a thin blackboard on the
   left and the page on the right, so the page gets the whole height (2026-10-16 UI-7 案A, pineさん "各機種対応、横持ち、
   縦持ち対応できる様にレイアウトを調節する". the phone's column was 460px wide, and the cards were 237px under the
   screen at 740×360). under the blackboard: めあて, the time and the names (they scroll there if they are many).
   each column scrolls by itself only when it must; the screen never does.
   the results: the board on the left too, and the words of the comparison smaller, so the last answer is seen ---------- */

@media (max-height: 499px) and (orientation: landscape) {
    body {
        max-width: 1200px;
        padding: 4px 12px 6px;
        gap: 4px;
    }

    .screen {
        gap: 6px;
    }

    .play-screen {
        display: grid;
        grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
        /* (the blackboard is never taller than 80% of the height: a very long message scrolls inside it) */
        grid-template-rows: fit-content(80%) minmax(0, 1fr);
        grid-template-areas:
            "board work"
            "side work";
        gap: 6px 12px;
        overflow: hidden;
    }

    .play-screen > .board-frame {
        grid-area: board;
        display: flex;
        flex-direction: column;
        min-height: 0;
        padding: 6px 6px 10px;
    }

    .play-side {
        grid-area: side;
        display: flex;
        flex-direction: column;
        gap: 6px;
        min-height: 0;
        overflow-y: auto;
        padding: 0 2px 4px 0;
    }

    .play-side > * {
        order: 0;
    }

    .play-work {
        grid-area: work;
        min-height: 0;
        overflow-y: auto;
        padding: 8px 14px;
    }

    .play-work:has(> .choice-box:not([hidden])),
    .play-work:has(> .method-box:not([hidden])) {
        min-height: 0;
    }

    /* the thin blackboard: one column (a computer's board has 2), and smaller chalk */
    .play-board {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        gap: 4px;
        min-height: 0;
        overflow-y: auto;
        padding: 8px 12px;
    }

    .play-board .board-head {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 2px 8px;
        padding-right: 64px;
    }

    .play-board .received-box,
    .play-board:has(.end-button:not([hidden])) .received-box {
        align-self: stretch;
        align-items: flex-start;
        text-align: left;
        margin-inline: 0;
        padding: 3px 8px 5px;
    }

    .play-board.is-start .role-title {
        text-align: left;
        font-size: 13px;
    }

    .play-board.is-start .role-name {
        font-size: 22px;
        margin-bottom: 0;
    }

    .round-title {
        font-size: 13px;
    }

    .mode-tag,
    .role-title,
    .play-board .role-title,
    .received-label {
        font-size: 12px;
    }

    .step-strip {
        gap: 6px;
        font-size: 12px;
    }

    .step-strip .is-now {
        font-size: 13px;
        padding: 0 8px;
    }

    .received-message {
        font-size: 24px;
    }

    .received-message.is-short-text {
        font-size: 28px;
    }

    .received-message.is-long-text {
        font-size: 16px;
    }

    .received-canvas {
        width: min(100%, 30dvh);
    }

    /* めあて under the blackboard: a page of its own (on a phone it is the top line of the page) */
    .aim-box {
        margin: 0;
    }

    .play-screen:has(.aim-box:not([hidden])) .play-work {
        border-radius: 6px;
    }

    /* a guess round where a drawing came: the blackboard takes the whole left column, and めあて and the names go over
       the page on the right (the page only needs the box and 送る) */
    .play-screen.is-guessing-picture {
        grid-template-rows: auto minmax(0, 1fr);
        grid-template-areas:
            "board side"
            "board work";
    }

    .play-screen.is-guessing-picture .play-board .received-box {
        flex: 1 1 auto;
    }

    /* (the drawing is as big as the room: the board never scrolls here. a scrollbar that came and went made the
       drawing smaller and bigger again and again) */
    .play-screen.is-guessing-picture .play-board {
        overflow: hidden;
    }

    .play-screen.is-guessing-picture .received-stage {
        min-height: 80px;
    }

    /* 広げる: the blackboard is put away, and めあて and the names too (the board gets the little height there is).
       the page takes the whole width, under the time. (no gap and no padding for the side: without a time limit it
       is empty, and its 10px were taken from the board) */
    .play-screen.is-big-drawing {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
        grid-template-areas:
            "side"
            "work";
        row-gap: 0;
    }

    .play-screen.is-big-drawing .play-side {
        padding-bottom: 0;
    }

    .play-screen.is-big-drawing .timer-box {
        margin-bottom: 4px;
    }

    .play-screen.is-big-drawing .aim-box,
    .play-screen.is-big-drawing .status-row {
        display: none;
    }

    /* the results: the board on the left, the page on the right */
    .result-screen {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
        grid-template-rows: minmax(0, 1fr);
        gap: 12px;
    }

    .result-board {
        height: 100%;
        box-sizing: border-box;
        justify-content: center;
        padding: 12px 10px;
    }

    .result-title {
        font-size: 22px;
        letter-spacing: 0.1em;
    }

    .result-sub {
        font-size: 12px;
    }

    .result-paper {
        min-height: 0;
        padding: 8px 16px;
    }

    /* "とまっています" inside the top of the page: the page starts right under the title line here, and the note hanging
       over its edge hid 音 and きまり (now 利用規約) (2026-10-16 review, 740×360) */
    .paused-note {
        top: 4px;
    }

    .compare-words {
        font-size: 18px;
    }

    .result-compare:not(.is-small) .compare-line.is-answer .compare-words {
        font-size: 24px;
    }

    .result-compare.is-held .compare-line.is-answer .compare-label {
        font-size: 16px;
    }

    .compare-label {
        font-size: 12px;
    }

    .result-compare {
        padding: 6px 12px 8px;
    }
}

/* a phone's parts held sideways: めあて is a page of its own (all its edges), not the top line of the page.
   the drawing board: the tools on its left, and the count and 送る on its right (like a computer: under the board,
   the line of 送る took the height of the board) */
@media (max-height: 499px) and (orientation: landscape) and (max-width: 899px) {
    .aim-box {
        border-bottom: 1px solid var(--paper-edge);
        border-radius: 6px;
    }

    /* the room (the class screen and the rules screen) like the play screen: a thin blackboard on the left, the page
       on the right with the whole height (the evening of 2026-10-16: the board took 140px on top, and 1 and a half
       rules could be seen above "この決まりで始める"). a long board scrolls by itself */
    .lobby-screen {
        display: grid;
        grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
        grid-template-rows: minmax(0, 1fr);
        gap: 6px 12px;
    }

    .lobby-screen > .board-frame {
        display: flex;
        flex-direction: column;
        min-height: 0;
        padding: 6px 6px 10px;
    }

    .lobby-board {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        padding: 8px 12px;
    }

    .lobby-paper {
        padding: 8px 12px;
    }
}

/* ---------- the drawing board on a screen held sideways and less than 500px tall (932×430 too, which is as wide as a
   computer): the tools on the left of the board; on its right the strip of what came (with やめる / 終わらせる), the
   colors, the count and 送る. 広げる: the board is a square as tall as the page, and the column on the right takes the
   rest of the width (2026-10-17 pineさん "横向きのとキャンバスをもっとよこに広げられると思う": the strip was a whole
   line over the board, so the board was 240px at 740×360, and the right part of the screen stayed empty).
   the board stays a square: every drawing is a square (the ones that come, the results, the picture to save) ---------- */

@media (max-height: 499px) and (orientation: landscape) {
    /* the tools: 2 columns of 40px buttons with their pictures only, for a finger (2026-10-16 UI-10: they were 34×30;
       at 932×430 the buttons of a computer were 34×30 too) */
    .draw-tools {
        display: grid;
        grid-template-columns: repeat(2, 40px);
        gap: 3px;
        align-content: start;
    }

    .draw-tools .tool-button,
    .draw-tools .width-button {
        justify-content: center;
        width: 40px;
        min-width: 0;
        height: 40px;
        padding: 0;
    }

    .draw-tools .tool-name {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    /* the 4 widths are buttons of the grid too (a computer 1240px wide or more kept them in one row, out of the column).
       (weaker than the phone's rule that puts them away behind the 太さ button) */
    .width-box {
        display: contents;
    }

    /* (the second selector is as strong as the computer's rules for 広げる, so this wins there too) */
    .play-work:has(> .method-box:not([hidden]) > .draw-area:not([hidden])),
    .play-screen.is-big-drawing .play-work:has(> .method-box:not([hidden]) > .draw-area:not([hidden])) {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) minmax(120px, 28%);
        /* (the count is as tall as its words, and the line of 送る takes the rest, at the bottom: why a shape disappeared
           is 2 or 3 lines, and it went under えらびなおす when a long message took the right column. 2026-10-17 review) */
        grid-template-rows: auto auto auto minmax(0, 1fr);
        grid-template-areas:
            "tools stage topic"
            "tools stage colors"
            "tools stage count"
            "tools stage bottom";
        column-gap: 12px;
        row-gap: 0;
    }

    /* 広げる: the column of the board is as wide as the board is tall (the page's height: the screen, less 54px of
       lines over and under it = the padding of the screen, the title line and the edges and padding of the page),
       and the column on the right takes the rest. the first line is for old browsers */
    .play-screen.is-big-drawing .play-work:has(> .method-box:not([hidden]) > .draw-area:not([hidden])) {
        grid-template-columns: auto minmax(0, calc(100vh - 54px)) minmax(150px, 1fr);
        grid-template-columns: auto minmax(0, calc(100dvh - 54px)) minmax(150px, 1fr);
        padding: 8px 10px 4px;
    }

    .play-work:has(> .method-box:not([hidden]) > .draw-area:not([hidden])) > .method-box,
    .method-box > .draw-area {
        display: contents;
    }

    /* the strip at the top of the right column: a very long message scrolls inside it */
    .draw-topic {
        margin-bottom: 8px;
    }

    .draw-topic-text {
        max-height: 30vh;
        max-height: 30dvh;
        overflow-y: auto;
    }

    .play-work:has(> .method-box:not([hidden]) > .draw-area:not([hidden])) .draw-count {
        margin-top: 0;
        text-align: left;
    }

    .play-work:has(> .method-box:not([hidden]) > .draw-area:not([hidden])) > .bottom-row,
    .play-screen.is-big-drawing .play-work:has(> .method-box:not([hidden]) > .draw-area:not([hidden])) > .bottom-row {
        grid-area: bottom;
        flex-direction: column;
        justify-content: flex-end;
        align-items: stretch;
        margin-top: 8px;
    }
}

/* ---------- a computer, while drawing big (広げる: every drawing starts so). 2026-10-17 pineさん "絵を描くときに
   キャンバスを大きく表示したい": the board gets the whole height of the page. the tools, the colors under them (the same
   night, pineさん "色を選ぶパレットも線の太さなどを選ぶところのしたにそろえて") and the count are one column on the left
   of the board, so nothing takes its height or its width on the right. えらびなおす and 送る are at the bottom of the
   left side (below). on a wide screen the page may be wider
   while drawing (the board was limited by the width of the page there).
   the left side, from the top (the same night, pineさん "お題は左上に付箋で表示／ルールや残り時間などはそのしたに表示"):
   what came on the yellow sticky note (the note of a phone's band, game.js showReceivedNote: in the place of the strip
   over the board), then めあて, the time and how many have finished ---------- */

@media (min-width: 900px) and (min-height: 500px) {
    body:has(> .play-screen.is-big-drawing:not([hidden])) {
        max-width: 1600px;
    }

    /* the side: wider on a wider screen (the board is limited by the height there, so it does not get smaller: at
       1280×800 the board's place is 100px wider than the board). the buttons at its bottom take the same width
       (2026-10-17 review: at 1366×625, the size of a maximized browser on a 1366×768 screen, the count and the line of
       who is gone were under the bottom of a 200px side) */
    .play-screen.is-big-drawing {
        --side-width: clamp(200px, 18vw, 240px);
        grid-template-columns: var(--side-width) minmax(0, 1fr);
        column-gap: 16px;
    }

    /* (room at the top of the side: the sticky note is a little tilted, and its やめる hangs over its top edge) */
    .play-screen.is-big-drawing .play-side {
        padding-top: 10px;
    }

    /* what came: the yellow sticky note at the top left. its label in the first line, beside やめる / 終わらせる that
       hangs from its top edge; the words under it have the whole width of the note (a long message in smaller
       letters: game.js is-long-text. never cut) */
    .play-screen.is-big-drawing .received-note {
        display: block;
        flex-shrink: 0;
        padding: 8px 12px 12px;
    }

    .play-screen.is-big-drawing .received-note-text {
        font-size: 19px;
    }

    .play-screen.is-big-drawing .received-note-text:has(.is-long-text) {
        font-size: 16px;
    }

    /* the label folds only before （ (keep-all: "届いた伝言／（ケータイ打ち）：", not in the name of the way), or anywhere
       if one part is wider than the note. only its first line leaves room for the button (the float at its start) */
    .play-screen.is-big-drawing .received-note-label {
        display: block;
        min-height: 26px;
        line-height: 1.5;
        word-break: keep-all;
        overflow-wrap: anywhere;
    }

    .play-screen.is-big-drawing .received-note:has(.end-sticky:not([hidden])) .received-note-label::before {
        content: "";
        float: right;
        width: 74px;
        height: 1em;
    }

    .play-screen.is-big-drawing .received-note .end-sticky {
        position: absolute;
        top: -8px;
        right: 10px;
        margin: 0;
    }

    /* (the strip over the board: what came is on the note now) */
    .play-screen.is-big-drawing .draw-topic {
        display: none;
    }

    /* the time left in one line: the seconds, then the ruler (one under the other it took 25px more of the side) */
    .play-screen.is-big-drawing .timer-box {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .play-screen.is-big-drawing .ruler {
        flex: 1;
        height: 22px;
        background-size: 100% 5px, 100% 9px;
    }

    .play-screen.is-big-drawing .ruler-marker {
        top: 10px;
    }

    /* (as strong as the rules for 広げる before this one, and later, so it wins over them) */
    .play-screen.is-big-drawing .play-work:has(> .method-box:not([hidden]) > .draw-area:not([hidden])) {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-rows: auto auto minmax(0, 1fr);
        grid-template-areas:
            "tools stage"
            "colors stage"
            "count stage";
        column-gap: 14px;
        padding: 14px 16px;
    }

    .play-screen.is-big-drawing .draw-tools {
        margin-bottom: 12px;
    }

    /* the screening on a computer: big words, and the drawing up to 480px in its half. (here, from 500px tall: a big
       phone held sideways is 900px wide too, and 54px letters were cut in its 284px place. 2026-10-18 review) */
    .screening .result-head {
        font-size: 20px;
    }

    .screening .result-text {
        font-size: 54px;
    }

    .screening .result-text.is-sent {
        font-size: 46px;
    }

    .screening .screen-card.is-long .result-text {
        font-size: 36px;
    }

    .screening .pictogram {
        width: 96px;
        height: 96px;
    }

    .screening .swatch {
        width: 72px;
        height: 72px;
    }

    .screening .result-canvas {
        width: min(480px, 100%);
        width: min(480px, 100cqw, max(140px, 100cqh));
    }

    .screen-label {
        font-size: 14px;
    }

    /* the colors: 4 in a line, as wide as the tools above them */
    .play-screen.is-big-drawing .color-box {
        gap: 5px 4px;
        margin-bottom: 10px;
    }

    .play-screen.is-big-drawing .color-button {
        width: 26px;
        height: 26px;
    }

    /* えらびなおす and 送る, one under the other at the bottom of the left side, under how many have finished (the same
       night: pineさん chose B of 4 pictures, "左の列の下"). in the code they stay at the end of the page (the keyboard
       comes to them after the board), and are laid on the desk at the bottom of the side column (position: absolute on
       the play screen. the side ends above them (a margin, not a padding: on a very short screen the side scrolls above the
       buttons, and nothing of it goes under them) */
    .play-screen.is-big-drawing {
        position: relative;
    }

    .play-screen.is-big-drawing .play-side {
        margin-bottom: 64px;
    }

    /* side by side, like on the other screens (one under the other they took 104px of the side's height) */
    .play-screen.is-big-drawing .play-work:has(> .method-box:not([hidden]) > .draw-area:not([hidden])) > .bottom-row {
        position: absolute;
        left: 0;
        bottom: 0;
        width: calc(var(--side-width) - 4px);
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 8px;
        margin: 0;
    }

    .play-screen.is-big-drawing .play-work:has(> .method-box:not([hidden]) > .draw-area:not([hidden])) .rechoose-button {
        flex: none;
        padding-inline: 10px;
    }

    .play-screen.is-big-drawing .play-work:has(> .method-box:not([hidden]) > .draw-area:not([hidden])) .send-button {
        flex: 1;
        align-self: auto;
        padding: 9px 0;
    }

    /* the board at the top of its place (on a very tall screen it is limited by the width, and in the middle it began
       94px under the tools at 2560×1440. 2026-10-17 review) */
    .play-screen.is-big-drawing .draw-stage {
        align-items: flex-start;
    }
}

/* (a computer under 1240px wide: the tools are pictures only already. 3 in a line, with the 4 widths in a line of
   their own, and the colors 4 in a line under them: the column is 110px, so えらびなおす fits in it.
   it never scrolls: the tools are 4 lines, and the page is at least 430px tall here. a scrollbar that came for a
   moment while the page was laid out made the board 15px narrower and back, and the browser said "ResizeObserver
   loop" (2026-10-17 review, at 1000×600)) */
@media (min-width: 900px) and (max-width: 1239px) and (min-height: 500px) {
    .play-screen.is-big-drawing .draw-tools {
        grid-template-columns: repeat(3, 34px);
        gap: 4px;
        overflow: visible;
    }

    .play-screen.is-big-drawing .width-box {
        display: flex;
        grid-column: 1 / -1;
        justify-content: space-between;
    }

    .play-screen.is-big-drawing .width-button {
        width: 25px;
    }

    .play-screen.is-big-drawing .color-button {
        width: 24px;
        height: 24px;
    }
}

/* ---------- a touch screen 900px wide or more (a sideways tablet): index.html shows the computer layout smaller
   there (0.83 on a 1024×768 tablet), so the buttons pressed with a finger stay about 44px on the screen, the small
   ones about 36px, and the colors 32px (2026-10-18). last in the file: as strong as the computer rules, and later ---------- */

@media (min-width: 900px) and (hover: none) {
    .triangle-button,
    .play-screen.is-big-drawing .draw-tools .tool-button {
        min-width: calc(44px / var(--page-scale, 1));
        min-height: calc(44px / var(--page-scale, 1));
    }

    /* (小さく: the column of the tools is shorter, so 36px: at 44px 広げる went under the colors at 1024×768) */
    .sub-button,
    .tool-button {
        min-height: calc(36px / var(--page-scale, 1));
    }

    .color-button,
    .play-screen.is-big-drawing .color-button {
        width: calc(32px / var(--page-scale, 1));
        height: calc(32px / var(--page-scale, 1));
    }
}

/* people who asked for less movement: no tilted notes */
@media (prefers-reduced-motion: reduce) {
    .choice-box button {
        transform: none;
    }

    /* no flipping card: the new text is just there. the frame of what came only changes its color (it does not move) */
    .picker-name.is-flipping {
        animation: none;
    }

    .received-box.is-new {
        animation: received-flash-still 1.4s ease-out;
    }

    /* the results: the new line, the last answer and the はなまる are just there (no sliding, no popping, no drawing).
       "さいごの答えは……" does not blink */
    .screen-card.is-entering,
    .screen-card.is-leaving,
    .result-compare:not(.is-small) .compare-line.is-answer .compare-words,
    .result-compare.is-held .compare-line.is-answer .compare-label {
        animation: none;
    }

    .screen-arrow .line-icon {
        transition: none;
    }

    .compare-hanamaru path {
        animation: none;
        stroke-dashoffset: 0;
    }
}

/* ---------- a phone held sideways: please turn it upright ----------
   (2026-10-18 pineさん "タイトル画面が中途半端に表示されているためバグっていると認識される／スマホの横画面の場合は縦画面に
   直すようにしてもらう": on every screen, with no button to go on sideways. a browser cannot lock the screen upright,
   so the page asks. the script in the head of index.html puts is-phone-sideways on <html>: a touch screen held
   sideways whose short side is under 600px. a tablet held sideways keeps the computer layout.
   the game goes on behind the notice; the page under it cannot be seen or pressed) */
.turn-notice {
    display: none;
}

/* (the board in the middle with margin: auto, not align-items: center: on a very short screen it is taller than the
   notice, and then it starts at the top and scrolls, instead of losing its top) */
.is-phone-sideways .turn-notice {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    overflow-y: auto;
    padding: 16px;
    background: var(--desk);
}

/* (visibility: the parts still have their sizes, so the game measures them as before, but they cannot be read out,
   pressed or reached with Tab. a part that says visibility: visible itself would show through: the shown mode
   panel does, so it is hidden here too. 2026-10-18 review) */
.is-phone-sideways body > :not(.turn-notice):not(.viewport-readout),
.is-phone-sideways .mode-panel.is-shown {
    visibility: hidden;
}

/* a small blackboard in a wooden frame, written with chalk */
.turn-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    max-width: 440px;
    margin: auto;
    padding: 18px 28px 20px;
    border: 6px solid var(--wood);
    border-radius: 6px;
    background-color: var(--board);
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 6px 6px;
    box-shadow: 0 3px 8px var(--shadow);
    color: var(--chalk);
    font-family: var(--chalk-font);
    font-weight: 400;
    text-align: center;
}

/* (the picture, the title and the text: the part read out as the request. laid out like the board around it) */
.turn-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.turn-picture {
    width: 150px;
    height: auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.turn-title {
    margin: 4px 0 0;
    font-size: 26px;
    line-height: 1.3;
}

.turn-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--chalk-yellow);
}

/* the time goes on behind the notice: the seconds left, under a chalk line (game.js showTimer. red from 10 seconds,
   like the ruler of the game) */
.turn-time {
    margin: 4px 0 0;
    padding-top: 8px;
    border-top: 2px dashed rgba(243, 240, 230, 0.35);
    font-size: 16px;
    line-height: 1.4;
}

.turn-seconds {
    font-size: 24px;
}

.turn-time.is-short {
    color: var(--chalk-pink);
}

/* a very short screen (an old iPhone SE sideways with the bars of the browser: about 230 tall): a smaller picture and
   less room around, so the board with the seconds still fits (it was 255 tall, 12px out at the top and the bottom) */
@media (max-height: 299px) {
    .is-phone-sideways .turn-notice {
        padding: 8px 16px;
    }

    .turn-board,
    .turn-message {
        gap: 4px;
    }

    .turn-board {
        padding: 10px 24px 12px;
    }

    .turn-picture {
        width: 96px;
    }

    .turn-title {
        margin-top: 0;
        font-size: 22px;
    }

    .turn-time {
        margin-top: 2px;
        padding-top: 5px;
    }

    .turn-seconds {
        font-size: 20px;
    }
}

/* ---------- ?vp=1: the numbers of the screen, for a photo (index.html, 2026-10-19. ⚠️take away before going public) ----------
   over everything, but it takes no taps. the letters stay about 11px on the screen whatever the page's scale */
.viewport-readout {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    max-width: 100vw;
    margin: 0;
    padding: 4px 6px;
    font: calc(11px / var(--page-scale, 1)) / 1.35 ui-monospace, monospace;
    white-space: pre-wrap;
    color: #fff;
    background: rgba(0, 0, 0, 0.72);
    pointer-events: none;
}
