@font-face {
  font-family: NH;
  src: url("/art/nh-handwriting.otf") format("opentype");
  font-display: swap;
}
:root {
  --ink: #173c49;
  --ocean: #0b5872;
  --teal: #267972;
  --coral: #c04738;
  --gold: #f4ba4e;
  --paper: #fffdf7;
  --line: #d8d9cd;
  --sand: #f7f3e8;
  --ui:
    Inter, "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic",
    Meiryo, sans-serif;
  color: var(--ink);
  background: var(--sand);
  font-family: var(--ui);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
a {
  color: var(--ocean);
}
:focus-visible {
  outline: 3px solid #1289a2;
  outline-offset: 3px;
}
button[disabled] {
  opacity: 0.54;
}
body:has(dialog[open]) {
  overflow: hidden;
}
#shell {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#live:empty,
#toast:empty {
  display: none;
}
#toast,
#live {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 120;
  padding: 10px 18px;
  border-radius: 12px;
  background: #183f4d;
  color: #fff;
  font-weight: 650;
  box-shadow: 0 5px 22px #122e4830;
  max-width: 90vw;
  text-align: center;
}
#live {
  pointer-events: none;
  opacity: 0;
}
.topbar {
  height: 64px;
  flex: none;
  background: #fffdf8;
  border-bottom: 1px solid #d5d8ca;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 max(4vw, calc((100vw - 1360px) / 2));
  z-index: 2;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #123f4e;
  font-size: clamp(16px, 2vw, 21px);
  font-weight: 850;
  letter-spacing: -0.055em;
  text-decoration: none;
}
.brand img {
  width: 39px;
  height: 39px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.top-link,
.bare {
  border: none;
  background: none;
  padding: 6px 1px;
  font-weight: 650;
  color: #304d56;
  text-decoration: none;
  font-size: 14px;
}
.top-link:hover,
.bare:hover {
  text-decoration: underline;
}
.lang-switch {
  border: 1px solid #bfc9c5;
  background: white;
  border-radius: 30px;
  padding: 2px;
  display: flex;
  align-items: center;
}
.lang-switch button {
  border: 0;
  border-radius: 30px;
  background: transparent;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 750;
  color: var(--ink);
}
.lang-switch [aria-pressed="true"] {
  background: var(--ocean);
  color: white;
}
.identity {
  font-size: 13px;
  color: #49616a;
  max-width: 14em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-menu {
  position: relative;
}
.account-menu summary {
  cursor: pointer;
}
.account-menu[open] .acct-pop {
  display: grid;
  gap: 8px;
}
.acct-pop {
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 160px;
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 5px 18px #13344220;
}
.mainbody {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.login-stage {
  width: min(1330px, 94vw);
  margin: auto;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: clamp(10px, 2vh, 24px);
  padding: clamp(12px, 3vh, 34px) 0;
  flex: 1;
  min-height: 0;
  max-height: 950px;
}
.entry-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(310px, 0.85fr);
  gap: clamp(15px, 2.6vw, 42px);
  align-items: stretch;
}
.art-panel {
  position: relative;
  isolation: isolate;
  margin: 0;
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d7d6c8;
  border-radius: 22px;
  box-shadow: 0 3px 0 #e3dfd0;
}
.art-panel:before,
.sample-paper:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 7px;
  background: repeating-linear-gradient(
    127deg,
    #ba493e 0 13px,
    #fdf9ef 13px 26px,
    #317579 26px 39px,
    #fdf9ef 39px 52px
  );
  z-index: 1;
}
.art-copy {
  position: relative;
  z-index: 1;
  flex: none;
  padding: clamp(17px, 3vh, 34px) clamp(22px, 3.1vw, 48px) 0;
  pointer-events: none;
}
.eyebrow,
.minor {
  font: 750 11px/1.2 var(--ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #47766b;
}
.art-copy h1 {
  font-family: Georgia, "Yu Mincho", serif;
  font-size: clamp(40px, min(5.45vw, 8.4vh), 83px);
  letter-spacing: -0.06em;
  line-height: 0.99;
  font-weight: 600;
  margin: 0.12em 0 0.12em;
  color: #173f47;
}
.art-copy h1 em {
  color: var(--coral);
  font-weight: 500;
}
.art-copy p {
  font: 500 clamp(12px, 1.25vw, 17px) / 1.4 var(--ui);
  color: #495d5e;
  margin: 0;
  max-width: 90%;
}
.login-art {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: block;
  object-fit: contain;
  object-position: 50% 60%;
  padding: 0 8px 6px;
}
.postmark {
  position: absolute;
  right: 4%;
  top: 24px;
  width: clamp(48px, 5.7vw, 78px);
  aspect-ratio: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
  border: 3px double #779389;
  border-radius: 50%;
  transform: rotate(11deg);
  color: #52796a;
  opacity: 0.85;
  background: #fffefaee;
  font-size: clamp(7px, 0.7vw, 10px);
  font-weight: 750;
  letter-spacing: 0.14em;
}
.postmark b {
  font: italic 650 clamp(13px, 2vw, 24px) / 0.9 Georgia;
  letter-spacing: -0.07em;
}
.art-copy {
  padding-right: 15%;
}
.login-box {
  align-self: center;
  background: #fffcf5;
  border: 1px solid #d9d7c8;
  border-radius: 20px;
  padding: clamp(18px, min(2.8vw, 3.5vh), 40px);
  box-shadow: 0 4px 0 #e4dfcf;
  position: relative;
}
.login-box h2,
.central h1,
.start-card h2 {
  font:
    650 clamp(24px, 2.9vw, 42px) / 1.05 Georgia,
    "Yu Mincho",
    serif;
  letter-spacing: -0.045em;
  margin: 0 0 0.45em;
}
.tabrow {
  display: flex;
  border-bottom: 1px solid #d8d8cb;
  gap: 20px;
  margin-bottom: clamp(10px, 2vh, 22px);
}
.tabrow button {
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 7px 2px 9px;
  margin-bottom: -1px;
  color: #596767;
  font-size: 14px;
  font-weight: 740;
}
.tabrow button[aria-selected="true"] {
  border-color: #b64938;
  color: var(--coral);
}
.field {
  display: grid;
  gap: 5px;
  margin: 0 0 12px;
  font: 700 13px/1.35 var(--ui);
}
.field input {
  width: 100%;
  min-height: 41px;
  border: 1px solid #b8c3b8;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 9px 11px;
  font: 500 16px/1.1 var(--ui);
}
.primary,
.secondary,
.google,
.demo-button {
  border-radius: 9px;
  border: 1px solid transparent;
  padding: 10px 15px;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-decoration: none;
  text-align: center;
}
.primary {
  background: var(--ocean);
  color: white;
  box-shadow: 0 2px 0 #093e4f;
}
.primary:hover {
  background: #09475b;
}
.secondary,
.google {
  background: white;
  color: var(--ink);
  border-color: #bec7b9;
}
.full {
  width: 100%;
}
.demo-button {
  background: #f6ead2;
  border-color: #dfcead;
  color: #674b22;
  width: 100%;
  font-size: 14px;
}
.login-box footer {
  border-top: 1px dashed #d9d2c3;
  padding-top: clamp(10px, 2vh, 22px);
  margin-top: clamp(10px, 2vh, 22px);
}
.errorline {
  color: #a02c24;
  font-size: 14px;
  line-height: 1.4;
}
.errorline:empty {
  display: none;
}
.hint {
  font-size: 14px;
  line-height: 1.5;
  color: #526469;
  margin: 8px 0 16px;
}
.google img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}
.teacher-entry {
  min-height: 129px;
}
.teacher-entry summary {
  font-size: 13px;
  cursor: pointer;
  margin: 14px 0 8px;
}
.stationery {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 1px 3px;
}
.sample-paper {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px;
  background: #fffdf7;
  border: 1px solid #d4d3c5;
  border-radius: 12px;
  box-shadow: 0 2px 0 #e3dfcf;
  text-align: left;
  overflow: hidden;
}
.sample-paper:before {
  display: none;
}
.sample-paper img {
  width: clamp(56px, 6vw, 83px);
  aspect-ratio: 1.5;
  object-fit: cover;
  box-shadow: 0 1px 3px #4f41333a;
  border: 1px solid #cfc4b9;
  transform: rotate(-3deg);
  border-radius: 2px;
  flex: none;
}
.sample-paper span {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.sample-paper b {
  font-size: clamp(11px, 1.18vw, 16px);
  line-height: 1.14;
  color: #24474d;
}
.sample-paper small {
  font-size: clamp(10px, 0.9vw, 12px);
  color: #627270;
}
.sample-paper:hover {
  background: #fff;
  transform: translateY(-1px);
}
.central {
  width: min(560px, 92%);
  margin: auto;
  padding: 26px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.central p {
  line-height: 1.5;
}
.player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px max(2vw, 12px);
  border-bottom: 1px solid var(--line);
  background: #fffaf0;
  flex: none;
}
.view-tabs {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}
.view-tabs button {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 7px 12px;
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
}
.view-tabs button[aria-pressed="true"] {
  background: #dceee6;
  border-color: #b5cfc3;
}
.wallet-count,
.demo-tag,
.save-indicator {
  font-size: 12px;
  font-weight: 700;
}
.wallet-count {
  white-space: nowrap;
}
.save-indicator {
  color: #5f746c;
  min-width: 0;
}
.right-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}
.view-host {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: auto;
}
.dialog-box {
  width: min(430px, 92vw);
  padding: 24px;
  border: 1px solid #bdc7be;
  background: var(--paper);
  border-radius: 16px;
  box-shadow: 0 20px 70px #11364545;
  color: var(--ink);
}
.dialog-box::backdrop {
  background: #1b344956;
}
.dialog-box h2 {
  font-family: Georgia, serif;
  margin: 0 0 12px;
}
.dialog-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}
.practice-modes {
  display: flex;
  align-items: center;
  gap: 5px;
}
.practice-modes select {
  max-width: 175px;
  border: 1px solid #bfc6b8;
  border-radius: 7px;
  background: #fff;
  padding: 5px;
  font-size: 12px;
  color: var(--ink);
}
.print-mark {
  color: var(--ocean);
  font-family: NH, sans-serif;
}
.dialog-preview {
  width: min(600px, 93vw);
}
.dialog-preview img {
  width: 100%;
  display: block;
  margin: 8px 0 16px;
  border-radius: 5px;
}
.btnrow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-height: 680px) and (min-width: 751px) {
  .topbar {
    height: 50px;
  }
  .login-stage {
    padding: 10px 0;
    gap: 10px;
  }
  .login-box {
    padding: 16px 24px;
  }
  .field {
    margin-bottom: 6px;
  }
  .field input {
    min-height: 34px;
    padding: 7px 10px;
  }
  .login-box footer {
    margin-top: 10px;
    padding-top: 10px;
  }
  .tabrow {
    margin-bottom: 8px;
  }
  .art-copy {
    padding-top: 16px;
  }
  .stationery .sample-paper {
    padding: 5px 8px;
  }
  .stationery img {
    width: 52px;
  }
}
@media (max-width: 750px) {
  .topbar {
    height: 54px;
    padding: 0 3.4vw;
  }
  .top-actions {
    gap: 8px;
  }
  .login-stage {
    width: 94vw;
    padding: 10px 0;
    gap: 9px;
  }
  .entry-grid {
    grid-template-columns: minmax(0, 1fr) minmax(230px, 0.8fr);
    gap: 10px;
  }
  .login-box {
    padding: 16px 14px;
  }
  .postmark {
    display: none;
  }
  .art-copy {
    padding: 18px 16px 0;
  }
  .art-copy h1 {
    font-size: 40px;
  }
  .sample-paper {
    gap: 6px;
    padding: 6px;
  }
  .sample-paper small {
    display: none;
  }
  .sample-paper img {
    width: 42px;
  }
  .stationery {
    gap: 5px;
  }
  .account-menu .identity {
    max-width: 84px;
  }
  .topbar .top-link {
    font-size: 12px;
  }
}
@media (max-width: 560px) and (orientation: portrait) {
  .topbar {
    height: 48px;
  }
  .brand {
    gap: 5px;
    font-size: 17px;
  }
  .brand img {
    width: 32px;
    height: 32px;
  }
  .top-link {
    font-size: 12px;
  }
  .lang-switch button {
    padding: 5px 8px;
  }
  .login-stage {
    display: flex;
    flex-direction: column;
    max-height: 950px;
    min-height: min-content;
    justify-content: center;
  }
  .entry-grid {
    display: flex;
    flex-direction: column;
    gap: 9px;
    flex: 1;
    min-height: 0;
  }
  .art-panel {
    min-height: 142px;
    flex: 1;
    max-height: 300px;
  }
  .art-copy {
    padding: 17px 12px 10px;
    width: 53%;
    margin: auto 0;
  }
  .art-copy h1 {
    font-size: clamp(31px, 9.2vw, 50px);
  }
  .art-copy p {
    font-size: 12px;
  }
  .eyebrow {
    font-size: 9px;
  }
  .login-art {
    position: absolute;
    right: 0;
    top: 10%;
    width: 51%;
    height: 84%;
    padding: 0;
    object-fit: contain;
  }
  .login-box {
    width: 100%;
    margin: 0;
    padding: 13px 17px;
    align-self: stretch;
  }
  .login-box h2 {
    font-size: 25px;
    margin-bottom: 5px;
  }
  .tabrow {
    margin-bottom: 8px;
  }
  .tabrow button {
    padding: 5px 1px;
  }
  .field {
    margin-bottom: 7px;
    gap: 3px;
  }
  .field input {
    min-height: 35px;
    padding: 6px 9px;
  }
  .login-box footer {
    padding-top: 7px;
    margin-top: 8px;
  }
  .demo-button,
  .login-box .primary {
    padding: 8px 12px;
  }
  .stationery {
    grid-template-columns: repeat(4, 1fr);
  }
  .sample-paper {
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    padding: 4px 2px;
  }
  .sample-paper b {
    font-size: 10px;
    text-align: center;
  }
  .sample-paper img {
    width: 40px;
  }
  .player-bar {
    padding: 4px 6px;
    gap: 3px;
    flex-wrap: wrap;
  }
  .view-tabs {
    gap: 1px;
  }
  .view-tabs button {
    padding: 6px 8px;
    font-size: 12px;
  }
  .right-tools {
    gap: 5px;
  }
  .practice-modes select {
    max-width: 108px;
  }
  .wallet-count,
  .save-indicator {
    font-size: 10px;
  }
}
@media (max-height: 460px) and (orientation: landscape) {
  .topbar {
    height: 38px;
  }
  .login-stage {
    min-height: 330px;
    padding: 6px 0;
  }
  .stationery {
    display: none;
  }
  .login-box {
    padding: 10px 16px;
  }
  .login-box h2 {
    font-size: 24px;
  }
  .field input {
    min-height: 27px;
  }
  .field {
    font-size: 11px;
  }
  .login-box footer {
    margin-top: 6px;
    padding-top: 5px;
  }
  .primary,
  .demo-button {
    padding: 6px 12px;
  }
}
@media print {
  #shell > .topbar,
  .player-bar,
  #toast,
  #live,
  dialog {
    display: none !important;
  }
  #shell,
  .mainbody,
  .view-host {
    display: block;
    height: auto;
    overflow: visible;
  }
}
.present-card {
  width: min(870px, 94vw, 114dvh);
  max-height: 94dvh;
  overflow: auto;
}
.presentation-title {
  font:
    600 clamp(23px, 4vh, 42px) / 1.1 NH,
    Georgia,
    serif !important;
}
.present-paper .gc-card {
  width: 100%;
  aspect-ratio: 3/2;
}
.view-tabs .show-card-btn {
  color: var(--ocean);
  border: 1px solid #bccfc2;
  background: #fffdf7;
}
.mainbody:has(.login-stage) {
  background:
    radial-gradient(
      ellipse at 8% 86%,
      #ffca36 0%,
      #ffbd42 10%,
      transparent 39%
    ),
    radial-gradient(
      ellipse at 88% 16%,
      #f85d65 0%,
      #f56a61 12%,
      transparent 45%
    ),
    radial-gradient(ellipse at 38% 0%, #1998a5 0%, transparent 51%),
    linear-gradient(118deg, #09668b 0%, #15888e 45%, #ed7662 86%);
}
.login-stage .art-panel,
.login-stage .login-box {
  border: 3px solid #fff;
  box-shadow: 0 5px 16px #173d4123;
}
.login-stage .sample-paper {
  border-color: #fff;
  box-shadow: 0 3px 10px #18394326;
}
.art-copy h1 {
  font-family: var(--ui);
  font-weight: 800;
}
.art-copy h1 em {
  font-family: Georgia, serif;
}
.login-box h2 {
  font-family: var(--ui);
  font-weight: 800;
}
.login-box {
  background: #fffcf7;
}
@media (max-width: 560px) and (min-height: 730px) and (orientation: portrait) {
  .login-stage .art-panel {
    max-height: none;
    min-height: 205px;
  }
  .login-stage .art-copy {
    width: 100%;
    margin: 0;
    padding: 15px 17px 2px;
  }
  .login-stage .art-copy h1 {
    font-size: clamp(23px, 7.7vw, 38px);
    line-height: 1.03;
    margin: 3px 0;
    white-space: nowrap;
  }
  .login-stage .art-copy p {
    max-width: 100%;
  }
  .login-stage .login-art {
    position: static;
    width: 100%;
    height: 0;
    min-height: 0;
    flex: 1;
    object-fit: contain;
    padding: 2px 6px 5px;
  }
}
/* Reserve the status row so autosave never shifts the card under a finger. */
@media (max-width: 460px) and (orientation: portrait) {
  .player-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .right-tools {
    min-height: 26px;
    justify-content: flex-end;
  }
}
