:root {
  color-scheme: light;
  --ink: #24242b;
  --muted: #6b655d;
  --paper: rgba(255, 255, 255, 0.82);
  --line: rgba(38, 35, 31, 0.14);
  --gold: #ffc83d;
  --teal: #238f96;
  --danger: #db5a4b;
  --shadow: 0 18px 50px rgba(63, 52, 36, 0.16);
  font-family: "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 200, 61, 0.24), transparent 32%),
    radial-gradient(circle at 82% 18%, rgba(219, 90, 75, 0.14), transparent 30%),
    linear-gradient(135deg, #fff7ea 0%, #f4ddd3 48%, #ecf4e8 100%);
}

button {
  height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.44;
  cursor: not-allowed;
  transform: none;
}

.app {
  width: min(1480px, 100%);
  display: grid;
  grid-template-columns: 120px minmax(520px, 760px) minmax(150px, 190px);
  gap: 18px;
  align-items: start;
}

.topbar {
  grid-column: 2;
  grid-row: 1;
  z-index: 4;
  display: flex;
  justify-content: start;
  align-items: start;
  gap: 16px;
  padding: 48px 0 0 54px;
  pointer-events: none;
}

h1 {
  margin: 0;
  color: rgba(36, 36, 43, 0.94);
  font-family: "Cooper Black", "Arial Rounded MT Bold", "Comic Sans MS", "Segoe UI", system-ui, sans-serif;
  font-size: clamp(31px, 3.6vw, 56px);
  line-height: 0.76;
  letter-spacing: 0.02em;
  white-space: pre-line;
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.72), 0 12px 28px rgba(68, 38, 28, 0.18);
}

.title-row {
  position: relative;
  display: inline-block;
}

.version-badge {
  position: absolute;
  left: clamp(220px, 20vw, 260px);
  top: clamp(46px, 3.7vw, 58px);
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 750;
}

.stats {
  display: grid;
  gap: 10px;
}

.stat {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 10px 28px rgba(55, 45, 32, 0.08);
  text-align: center;
}

.stat b,
.stat span {
  display: block;
}

.stat b {
  color: var(--muted);
  font-size: 14px;
}

.stat span {
  margin-top: 2px;
  font-size: 22px;
  font-weight: 950;
}

.stat em {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  line-height: 1.1;
}

.stat span.urgent {
  color: var(--danger);
}

.play-section,
.left-expelled,
.today-gut,
.side {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.play-section {
  grid-column: 2;
  grid-row: 1 / span 2;
  padding: clamp(8px, 1.2vw, 12px);
}

.gut-frame {
  position: relative;
  width: min(100%, 720px);
  margin: 0 auto;
  aspect-ratio: 13 / 18;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid rgba(122, 76, 67, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.16)),
    #ffe8dc;
}

.gut-hud {
  position: absolute;
  z-index: 6;
}

.gut-sensitivity {
  top: 4.2%;
  left: 67.8%;
  min-width: 96px;
  transform: translateX(-50%);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
  backdrop-filter: none;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.82), 0 8px 18px rgba(77, 41, 35, 0.16);
}

.gut-sensitivity b,
.gut-sensitivity span {
  display: block;
}

.gut-sensitivity b {
  color: rgba(91, 67, 62, 0.9);
  font-size: 13px;
  font-weight: 850;
}

.gut-sensitivity span {
  color: var(--ink);
  font-size: 29px;
  font-weight: 950;
  line-height: 1;
}

.gut-time {
  margin-top: 5px;
}

.gut-time span {
  color: var(--danger);
  font-size: 26px;
}

.gut-time span.urgent {
  color: var(--danger);
}

.pause-shield {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  place-items: center;
  align-content: center;
  gap: 12px;
  background:
    repeating-linear-gradient(135deg, #24242b 0 14px, #30303a 14px 28px);
  color: #fff;
  font-weight: 950;
  letter-spacing: 0;
  text-align: center;
}

.pause-shield b,
.pause-shield span {
  display: block;
}

.pause-shield b {
  font-size: 30px;
}

.pause-shield span {
  max-width: 280px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.45;
}

.pause-menu {
  width: min(360px, calc(100% - 48px));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.pause-menu button {
  height: 42px;
  min-width: 0;
  padding: 0 10px;
  font-size: 13px;
}

.pause-shield.show {
  display: grid;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.side {
  grid-column: 3;
  grid-row: 1 / span 2;
  display: grid;
  gap: 14px;
  padding: 12px;
  text-align: center;
}

.today-gut {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  align-self: stretch;
  max-height: 760px;
  margin-top: 104px;
  padding: 1px;
  text-align: center;
}

.left-expelled {
  grid-column: 1;
  grid-row: 1;
  z-index: 4;
  align-self: start;
  min-width: 0;
  text-align: center;
}

.today-gut h2 {
  margin: 0;
  padding: 8px 4px 2px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.today-gut ul {
  min-height: 0;
  margin: 0;
  padding: 0;
  display: grid;
  align-content: start;
  justify-items: center;
  grid-auto-flow: row;
  gap: 8px;
  overflow-y: auto;
  scrollbar-gutter: stable both-edges;
  scrollbar-width: thin;
  scrollbar-color: rgba(122, 96, 86, 0.38) transparent;
  list-style: none;
}

.today-gut ul::-webkit-scrollbar {
  width: 6px;
}

.today-gut ul::-webkit-scrollbar-track {
  background: transparent;
}

.today-gut ul::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(122, 96, 86, 0.28);
}

.today-gut ul::-webkit-scrollbar-thumb:hover {
  background: rgba(122, 96, 86, 0.42);
}

.today-gut-item {
  display: block;
  justify-self: center;
  width: var(--today-gut-cell-size, 96px);
  min-height: var(--today-gut-cell-size, 96px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  overflow: hidden;
}

.today-gut-token {
  width: var(--today-gut-cell-size, 96px);
  height: var(--today-gut-cell-size, 96px);
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 0;
  background: rgba(255, 244, 232, 0.56);
  overflow: hidden;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
  font-size: 28px;
}

.today-gut-token img {
  width: 86%;
  height: 86%;
  object-fit: contain;
  display: block;
}

.today-gut-item > span:last-child {
  display: none;
}

.today-gut-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.next-panel,
.rules {
  display: grid;
  gap: 10px;
}

.next-panel h2,
.rules h2,
.rules h3 {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  text-align: center;
}

.rules h3 {
  margin-top: 4px;
}

.next-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: center;
  justify-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 12px 24px rgba(58, 37, 28, 0.1);
  backdrop-filter: blur(8px);
}

.next-preview {
  position: relative;
  width: 116px;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff6df;
  border: 1px solid rgba(44, 39, 32, 0.12);
  overflow: hidden;
}

.next-food-icon {
  --food: #ffc83d;
  --accent: #7c5a00;
  width: 88%;
  height: 88%;
  display: grid;
  place-items: center;
  border: 3px solid var(--accent);
  border-radius: 50%;
  background: var(--food);
  font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
  font-size: 46px;
  line-height: 1;
  box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.12);
}

.next-food-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.next-food-icon.pepper,
.next-food-icon.bean {
  border-radius: 48% 52% 58% 42%;
  transform: rotate(-14deg);
}

.next-food-icon.bean {
  transform: rotate(18deg);
}

.next-food-icon.cube {
  border-radius: 12px;
}

.next-food-icon.burger {
  height: 60%;
  border-radius: 38px;
  background:
    linear-gradient(#d79a55 0 32%, var(--food) 33% 58%, #f2d25c 59% 72%, #c98245 73%);
}

.next-food-icon.spiral {
  background:
    radial-gradient(circle at 50% 50%, transparent 0 12%, var(--accent) 13% 17%, transparent 18% 27%, var(--accent) 28% 33%, transparent 34%),
    var(--food);
}

.next-card strong,
.next-card span {
  display: none;
}

.next-card strong {
  font-size: 17px;
  font-weight: 950;
}

.next-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.settings-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding-top: 2px;
}

.settings-actions {
  order: 2;
}

.message {
  order: 3;
}

.secondary {
  color: var(--ink);
  background: linear-gradient(180deg, #fff 0%, #fffaf2 100%);
  border: 1px solid rgba(38, 35, 31, 0.18);
  box-shadow:
    0 4px 0 rgba(100, 78, 55, 0.16),
    0 12px 24px rgba(58, 37, 28, 0.1);
}

.secondary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 6px 0 rgba(100, 78, 55, 0.14),
    0 16px 28px rgba(58, 37, 28, 0.12);
}

.secondary:active {
  transform: translateY(2px);
  box-shadow:
    0 1px 0 rgba(100, 78, 55, 0.18),
    0 8px 18px rgba(58, 37, 28, 0.08);
}

.secondary.is-off {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.56);
}

.danger-lite {
  color: #8b392f;
}

.rules ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.rules li + li {
  margin-top: 6px;
}

.effect-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding-left: 0;
  list-style: none;
}

.effect-list li {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px;
  align-items: start;
  padding: 7px 8px;
  border: 1px solid rgba(38, 35, 31, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
}

.effect-list li + li {
  margin-top: 0;
}

.effect-list b {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.25;
}

.effect-list span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.message {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(35, 143, 150, 0.12);
  color: #225f64;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.35;
  text-align: center;
}

.message.danger {
  background: rgba(219, 90, 75, 0.13);
  color: #96392f;
}

.message.is-hidden {
  display: none;
}

.rules-dialog {
  width: min(560px, 100%);
  text-align: left;
}

.rules-dialog h2,
.rules-dialog h3 {
  margin: 0 0 10px;
  color: var(--muted);
}

.rules-dialog ul {
  margin: 0 0 16px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.expel-wisp {
  position: fixed;
  z-index: 11;
  pointer-events: none;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 18%, var(--wisp-color) 36%, rgba(255, 255, 255, 0) 74%);
  box-shadow:
    0 0 12px var(--wisp-color),
    0 0 22px rgba(255, 244, 210, 0.58);
  filter: blur(0.2px);
  mix-blend-mode: screen;
}

.expel-wisp.landing {
  z-index: 12;
  box-shadow:
    0 0 16px var(--wisp-color),
    0 0 34px rgba(255, 244, 210, 0.78);
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  place-items: center;
  padding: 22px;
  background: rgba(28, 26, 24, 0.42);
}

.overlay.show {
  display: grid;
}

#gameOverOverlay.show {
  display: block;
}

#gameOverOverlay .ending-box {
  position: fixed;
  left: var(--game-over-center-x, 50vw);
  top: var(--game-over-center-y, 50vh);
  transform: translate(-50%, -50%);
}

.overlay-box {
  width: min(430px, 100%);
  padding: 24px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.overlay-box h2 {
  margin: 12px 0 6px;
  font-size: 30px;
}

.overlay-box p {
  margin: 0 0 18px;
  color: var(--muted);
  font-weight: 750;
  white-space: pre-line;
}

.mobile-control-hint {
  display: none;
}

.mobile-control-box {
  width: min(360px, 100%);
}

.mobile-control-box h2 {
  margin-top: 0;
}

.ending-box {
  width: min(520px, 100%);
}

.ending-hero {
  width: 230px;
  min-height: 230px;
  display: grid;
  place-items: center;
  margin: 0 auto 8px;
}

.ending-momoku {
  width: 220px;
  height: 220px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 244, 232, 0.72);
  box-shadow: inset 0 -16px 22px rgba(32, 28, 20, 0.08);
  overflow: hidden;
}

.ending-momoku img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ending-count {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 211, 70, 0.24);
  color: #5f4210;
  font-size: 14px;
  font-weight: 950;
}

.ending-rank {
  margin: -6px 0 16px;
  color: #225f64;
  font-size: 16px;
  font-weight: 950;
}

.ending-rank.is-busy {
  color: var(--muted);
}

.logo-token {
  width: 92px;
  height: 72px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border-radius: 46% 54% 42% 58%;
  background: var(--gold);
  color: #3b2b00;
  font-size: 42px;
  font-weight: 950;
  box-shadow: inset 0 -12px 20px rgba(32, 28, 20, 0.1);
}

.logo-token.danger {
  background: var(--danger);
  color: #fff;
}

@media (max-width: 880px) {
  body {
    padding: 14px;
    place-items: start center;
  }

  .app {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .topbar,
  .play-section,
  .left-expelled,
  .today-gut,
  .side {
    grid-column: 1;
    grid-row: auto;
  }

  .topbar {
    order: 1;
    padding: 0;
    pointer-events: auto;
  }

  .left-expelled {
    order: 2;
  }

  .play-section {
    order: 3;
  }

  .side {
    order: 4;
  }

  .today-gut {
    order: 5;
    margin-top: 0;
  }

  .today-gut {
    max-height: 150px;
  }

  .today-gut ul {
    grid-auto-flow: column;
    grid-auto-columns: minmax(116px, 150px);
    overflow-x: auto;
    overflow-y: hidden;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .stats {
    justify-content: stretch;
    width: 100%;
  }

  .stat {
    flex: 1 1 96px;
  }

  .gut-frame {
    width: min(100%, 520px);
  }
}

@media (max-width: 640px) and (orientation: portrait) {
  body {
    min-height: 100dvh;
    display: block;
    padding: 8px 8px max(8px, env(safe-area-inset-bottom));
    overflow-x: hidden;
    background:
      linear-gradient(180deg, rgba(255, 247, 234, 0.98) 0%, rgba(244, 221, 211, 0.92) 56%, rgba(236, 244, 232, 0.96) 100%);
  }

  .app {
    width: 100%;
    min-height: calc(100dvh - 16px);
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 6px;
    align-content: start;
    position: relative;
  }

  .topbar {
    position: fixed;
    top: 26px;
    left: 26px;
    z-index: 7;
    order: 0;
    gap: 8px;
    justify-content: start;
    text-align: left;
    pointer-events: none;
    display: block;
  }

  h1 {
    font-size: 25px;
    line-height: 0.9;
  }

  .title-row {
    display: inline-block;
  }

  .version-badge {
    left: 128px;
    top: 36px;
    padding: 3px 6px;
    font-size: 10px;
  }

  .subtitle {
    display: none;
  }

  .stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .stat {
    min-width: 0;
    padding: 7px 6px;
    border-radius: 8px;
  }

  .stat b {
    font-size: 9px;
  }

  .stat span {
    font-size: 16px;
  }

  .stat em {
    margin-top: 1px;
    font-size: 9px;
  }

  .play-section {
    grid-column: 1 / -1;
    padding: 6px;
    order: 1;
    touch-action: none;
  }

  .left-expelled {
    position: static;
    grid-column: 1;
    order: 2;
    z-index: auto;
    width: auto;
    height: 42px;
    padding: 5px 4px;
    box-shadow: 0 8px 20px rgba(63, 52, 36, 0.12);
    pointer-events: none;
  }

  .left-expelled b {
    font-size: 9px;
  }

  .left-expelled span {
    margin-top: 0;
    font-size: 15px;
  }

  .today-gut {
    position: static;
    grid-column: 2;
    order: 2;
    min-width: 0;
    width: 100%;
    height: 42px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px;
    align-items: center;
    padding: 5px 7px;
    box-shadow: 0 8px 20px rgba(63, 52, 36, 0.12);
    pointer-events: auto;
  }

  .today-gut h2 {
    display: block;
    padding: 0;
    white-space: nowrap;
    font-size: 10px;
  }

  .today-gut ul {
    min-width: 0;
    grid-auto-flow: column;
    grid-auto-columns: 36px;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .today-gut ul::-webkit-scrollbar {
    display: none;
  }

  .today-gut-item {
    width: 36px;
    min-height: 36px;
  }

  .today-gut-token {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .today-gut-empty {
    padding: 0 2px;
    align-self: center;
    font-size: 9px;
    line-height: 1.25;
  }

  .today-gut.is-empty {
    display: grid;
  }

  .today-gut.is-empty ul {
    grid-auto-columns: minmax(0, 1fr);
  }

  .today-gut.is-empty .today-gut-item {
    width: auto;
    min-height: 0;
  }

  .today-gut.is-empty .today-gut-empty {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .gut-frame {
    width: min(100%, calc((100dvh - 178px) * 13 / 18));
    min-width: min(100%, 286px);
    max-width: 430px;
    margin: 0 auto;
  }

  .gut-sensitivity {
    top: 3.2%;
    left: 68.4%;
    min-width: 62px;
  }

  .gut-sensitivity b {
    font-size: 10px;
  }

  .gut-sensitivity span {
    font-size: 20px;
  }

  .gut-time {
    margin-top: 2px;
  }

  .gut-time span {
    font-size: 18px;
  }

  .side {
    grid-column: 1 / -1;
    order: 3;
    grid-template-columns: 56px minmax(0, 1fr);
    grid-template-rows: 42px 40px 34px;
    align-items: stretch;
    column-gap: 6px;
    row-gap: 7px;
    margin-top: 0;
    padding: 6px;
    box-shadow: 0 10px 30px rgba(63, 52, 36, 0.12);
  }

  .next-panel {
    grid-row: 1 / span 2;
    align-self: stretch;
    gap: 0;
  }

  .next-panel h2 {
    display: none;
  }

  .next-card {
    grid-template-columns: 1fr;
    align-content: center;
    min-height: 100%;
    gap: 3px;
    padding: 5px;
  }

  .next-card::before {
    content: "NEXT";
    display: block;
    color: var(--muted);
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
  }

  .next-preview {
    width: 42px;
  }

  .next-card strong {
    font-size: 16px;
    line-height: 1.15;
  }

  .next-card span {
    font-size: 12px;
    line-height: 1.25;
  }

  .next-food-icon {
    font-size: 22px;
    border-width: 2px;
  }

  .settings-actions {
    order: 2;
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 0;
  }

  button {
    height: 40px;
    border-radius: 8px;
    padding: 0 8px;
    font-size: 13px;
    line-height: 1.1;
    overflow-wrap: anywhere;
  }

  .settings-actions button {
    min-width: 0;
    padding: 0 5px;
    font-size: 12px;
  }

  .pause-menu {
    width: min(280px, calc(100% - 28px));
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .pause-menu button {
    height: 38px;
    padding: 0 7px;
    font-size: 12px;
  }

  .ending-rank {
    margin: -4px 0 14px;
    font-size: 14px;
  }

  .rules {
    gap: 6px;
  }

  .rules h2,
  .rules ul:first-of-type {
    display: none;
  }

  .rules h3 {
    font-size: 12px;
  }

  .effect-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .effect-list li {
    grid-template-columns: 1fr;
    gap: 2px;
    min-height: 45px;
    padding: 6px;
  }

  .effect-list b,
  .effect-list span {
    font-size: 10px;
  }

  .message {
    grid-column: 2;
    order: 3;
    min-height: 32px;
    padding: 6px 8px;
    font-size: 11px;
  }

  .overlay {
    padding: 14px;
  }

  .overlay-box {
    padding: 20px;
  }

  .overlay-box h2 {
    font-size: 26px;
  }

  .mobile-control-box .mobile-control-hint {
    display: block;
    margin: 0 0 18px;
    color: #225f64;
    font-size: 16px;
    font-weight: 850;
    line-height: 1.45;
  }

  .ending-hero {
    width: 180px;
    min-height: 180px;
  }

  .ending-momoku {
    width: 170px;
    height: 170px;
  }
}

@media (max-width: 380px) and (orientation: portrait) {
  h1 {
    font-size: 22px;
  }

  .gut-frame {
    width: min(100%, calc((100dvh - 178px) * 13 / 18));
  }

  .topbar {
    top: 24px;
    left: 24px;
  }

  .version-badge {
    left: 116px;
    top: 33px;
    font-size: 9px;
  }

  .left-expelled {
    height: 40px;
  }

  .today-gut {
    height: 40px;
  }

  .side {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .next-preview {
    width: 40px;
  }

  .settings-actions button {
    font-size: 10px;
  }
}
