/* sonnle.com: what every page shares. The values (colours, type, spacing, the cut corner)
   are those of the "One sentence" mockup. */

@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url(/assets/fonts/sora-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url(/assets/fonts/sora-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #0B0F1A;
  --blue: #1F3BFF;
  --muted: #5B6685;
  --line: #AEB8D2;      /* underlines, field borders */
  --bracket: #8F9AB8;   /* the corner marks */
  --dot: #D0D7E8;       /* the dotted grid */
  --wash: #EEF1FA;
  --open: #E6EAFF;      /* behind a phrase that is open */
  --paper: #FFFFFF;
  --alarm: #C8102E;
  --pad-x: clamp(28px, 5vw, 72px);
  --cut: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); }
a { color: var(--blue); }
a:hover { color: var(--ink); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
[hidden] { display: none !important; }

@keyframes sl-open { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* The sheet: white, a faint dotted grid, a mark in each corner. */
.page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle, var(--dot) 1px, rgba(208, 215, 232, 0) 1.6px) 0 0 / 28px 28px, var(--paper);
  color: var(--ink);
  font-family: 'Sora', 'Helvetica Neue', Arial, sans-serif;
}
.corner { position: absolute; width: 18px; height: 18px; pointer-events: none; }
.corner.tl { top: 16px; left: 16px; border-top: 1px solid var(--bracket); border-left: 1px solid var(--bracket); }
.corner.tr { top: 16px; right: 16px; border-top: 1px solid var(--bracket); border-right: 1px solid var(--bracket); }
.corner.bl { bottom: 16px; left: 16px; border-bottom: 1px solid var(--bracket); border-left: 1px solid var(--bracket); }
.corner.br { bottom: 16px; right: 16px; border-bottom: 1px solid var(--bracket); border-right: 1px solid var(--bracket); }

/* The top line: the name on the left, the links on the right. */
.top {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 34px var(--pad-x) 20px;
}
.name { font-size: 15px; font-weight: 600; color: var(--ink); text-decoration: none; }
a.name { display: inline-flex; align-items: center; min-height: 44px; }
.top nav { display: flex; flex-wrap: wrap; column-gap: 22px; row-gap: 0; }
.navlink {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font-size: 14px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--line);
  text-underline-offset: 5px;
}
.navlink:hover { text-decoration-color: var(--ink); }
.navlink[aria-current="page"] { color: var(--blue); text-decoration-color: rgba(31, 59, 255, 0); }
@media (max-width: 480px) {  /* keep the three links on one line on a phone */
  .top nav { column-gap: 14px; }
  .top .navlink { font-size: 13px; }
}

/* A sentence set the way the home page sets its one sentence. */
.sentence {
  margin: 0;
  max-width: 26em;
  font-size: clamp(18px, 1.6vw, 23px);
  font-weight: 300;
  line-height: 2;
  letter-spacing: -0.01em;
}
.mark {  /* a few words picked out, like an open phrase on the home page */
  font-weight: 400;
  color: var(--blue);
  background: var(--open);
  padding: 0.28em 0.32em 0.28em 0.26em;
  white-space: nowrap;
  clip-path: polygon(0 0, calc(100% - 0.3em) 0, 100% 0.3em, 100% 100%, 0 100%);
}
.small { margin: 0; font-size: 13px; line-height: 1.7; color: var(--muted); }

/* Fields and buttons */
.field {
  height: 44px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 14px 'Sora', 'Helvetica Neue', Arial, sans-serif;
}
.field::placeholder { color: var(--muted); opacity: 1; }
.field:focus-visible { outline-offset: -1px; border-color: var(--blue); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 0;
  background: var(--blue);
  color: var(--paper);
  font: 400 14px 'Sora', 'Helvetica Neue', Arial, sans-serif;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  clip-path: var(--cut);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: -4px; }
.btn[disabled] { background: var(--line); cursor: default; }
.textbtn {  /* a button that reads as a link */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: 400 14px 'Sora', 'Helvetica Neue', Arial, sans-serif;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--line);
  text-underline-offset: 5px;
  cursor: pointer;
}
.textbtn:hover { text-decoration-color: var(--ink); }
.textbtn.armed { color: var(--alarm); text-decoration-color: var(--alarm); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.row .field { flex: 1 1 180px; }
.problem { margin: 0; font-size: 13px; line-height: 1.7; color: var(--alarm); }

/* ---- Home: the one sentence ---- */
.home {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 26px;
  padding: clamp(48px, 12vw, 180px) var(--pad-x) 64px clamp(28px, 16vw, 232px);
}
.photo {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: cover;
  background: var(--wash);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
}
.phrase {
  font: inherit;
  font-weight: 400;
  letter-spacing: inherit;
  border: 0;
  margin: 0;
  padding: 0 0.32em 0 0.26em;
  min-height: 44px;
  cursor: pointer;
  white-space: nowrap;
  color: var(--blue);
  background: rgba(230, 234, 255, 0);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--blue);
  text-underline-offset: 0.3em;
  clip-path: polygon(0 0, calc(100% - 0.3em) 0, 100% 0.3em, 100% 100%, 0 100%);
}
.phrase[aria-expanded="true"] { background: var(--open); text-decoration-color: rgba(31, 59, 255, 0); }
.more-text { color: var(--muted); animation: sl-open 0.25s ease both; }
.press { display: flex; flex-wrap: wrap; column-gap: 22px; row-gap: 0; max-width: 600px; animation: sl-open 0.3s ease both; }

/* ---- Inner circle ---- */
.circle {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 26px;
  padding: clamp(40px, 9vw, 130px) var(--pad-x) 64px clamp(28px, 16vw, 232px);
}
.circle form { width: min(100%, 420px); }
.things { list-style: none; margin: 0; padding: 0; width: min(100%, 560px); display: grid; gap: 18px; }
.thing { padding: 20px 22px 22px; border: 1px solid var(--line); background: var(--paper); }
.thing h2 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.thing p { margin: 0 0 16px; font-size: 14px; line-height: 1.7; color: var(--muted); }

/* ---- The riichi table: a thin bar, then the lobby or (once you are dealt in) the trainer's own page ---- */
.shell { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; color: var(--ink); font-family: 'Sora', 'Helvetica Neue', Arial, sans-serif; }
.shell-bar { position: relative; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 44px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--paper); }
.shell-bar .navlink, .shell-bar a.name { min-height: 44px; white-space: nowrap; }
.shell-frame { flex: 1; width: 100%; min-height: 0; border: 0; display: block; }
.shell-frame[hidden], .lobby[hidden] { display: none; }
.shell-menu { min-width: 0; font-size: 13px; }
.shell-menu summary { display: flex; align-items: center; height: 44px; max-width: 46vw; color: var(--muted); cursor: pointer; list-style: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--line); text-underline-offset: 5px; }
.shell-menu summary::-webkit-details-marker { display: none; }
.shell-menu summary.alert { color: var(--alarm); text-decoration-color: var(--alarm); }
.shell-panel { position: absolute; z-index: 5; top: 44px; left: 50%; transform: translateX(-50%); width: min(92vw, 380px); padding: 8px 18px 10px; border: 1px solid var(--line); background: var(--paper); }
.players, .seats { list-style: none; margin: 0; padding: 0; }
.player, .seat-row { display: flex; align-items: baseline; gap: 10px; min-height: 40px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.player { align-items: center; padding: 0; }
.player .textbtn { margin-left: auto; font-size: 13px; }
.seat-name { font-weight: 600; overflow-wrap: anywhere; }
.seat-note { font-size: 13px; color: var(--muted); }
.seat-row.ai .seat-name, .seat-row.away .seat-name { font-weight: 400; color: var(--muted); }
.shell-note { flex: none; margin: 0; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--open); font-size: 13px; line-height: 44px; }
.shell-note .textbtn { margin-left: 8px; font-size: 13px; }
.lobby { flex: 1; overflow: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 22px; padding: clamp(32px, 8vw, 110px) var(--pad-x) 64px clamp(28px, 16vw, 232px); background-color: var(--paper); }
.lobby .seats { width: min(100%, 420px); border-top: 1px solid var(--line); }
.lobby form { width: min(100%, 420px); }
.lobby #start-row { width: min(100%, 420px); }
.lobby #start-row .field { flex: 0 1 170px; }
.lobby .small { max-width: 34em; }

/* For screen readers only: a page title that is not drawn */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
