

@media (max-width: 620px) {
  .tray {
    gap: 8px;
    padding: 8px 10px;
    max-width: 100%;
  }
  .dice-btn {
    width: 76px;
    height: 76px;
    flex-shrink: 0;
  }
  .info {
    min-width: 0;
  }
  .turn {
    font-size: 19px;
  }
  .hint {
    font-size: 12px;
  }
  .score {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
    width: 100%;
  }
  .chip {
    min-width: 0;
    padding: 3px 2px;
    gap: 2px;
    font-size: 12px;
  }
  .chip i {
    width: 14px;
    height: 13px;
    flex: none;
  }
  .chip i:before,
  .chip i:after {
    width: 5px;
    height: 5px;
    top: -2px;
  }
}

.stage.wide .tray {
  width: 300px;
  padding: 57px 20px 27px;
  border: 0;
  background: transparent;
  box-shadow: none;
  isolation: isolate;
  gap: 17px;
}
.cat-panel {
  display: none;
}
.stage.wide .cat-panel {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  filter: drop-shadow(0 12px 16px #777db638);
}
.stage.wide .tray:before,
.stage.wide .tray:after {
  display: none;
}
.stage.wide .dice-btn {
  width: 146px;
  height: 146px;
  background: #e3e4fc;
  box-shadow:
    0 0 0 6px #eeeefe,
    inset 0 0 0 3px #bfc4eb;
}
.stage.wide .turn {
  min-width: 175px;
  font-size: 25px;
  padding: 13px 18px;
}
.stage.wide .hint {
  font-size: 16px;
  line-height: 1.25;
}
.stage.wide .score {
  gap: 9px;
}
.stage.wide .chip {
  padding: 6px 12px;
  font-size: 17px;
  min-height: 32px;
}
.stage.wide .chip i {
  width: 36px;
  height: 34px;
}
.chip i {
  display: inline-block;
  background: none !important;
  box-shadow: none !important;
  border-radius: 0;
}
.chip i:before,
.chip i:after {
  display: none;
}
@media (max-width: 620px) {
  .chip i {
    width: 24px;
    height: 24px;
  }
  .tray {
    isolation: isolate;
  }
}

@media (min-width: 1000px) {
  .stage.wide {
    padding-left: 70px;
  }
  .stage.wide .tray {
    width: 320px;
    padding: 65px 22px 34px;
    gap: 19px;
  }
  .stage.wide .dice-btn {
    width: 150px;
    height: 150px;
  }
  .stage.wide .hint {
    font-size: 18px;
    max-width: 210px;
  }
  .stage.wide .turn {
    font-size: 27px;
    min-width: 185px;
  }
  .stage.wide .chip {
    font-size: 18px;
    min-height: 39px;
  }
  .stage.wide .chip i {
    width: 38px;
    height: 38px;
  }
}
.stage.wide .dice-btn {
  background: linear-gradient(135deg, #eeedff, #d4d5f4);
  box-shadow:
    0 0 0 6px #f3f1ff,
    inset 0 2px 2px #fff,
    inset 0 -3px 4px #bfc1e4,
    0 8px 13px #777da52b;
}
.chip i canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.seat-cat {
  width: 40px;
  height: 34px;
  flex: none;
}
.seat.off .seat-cat {
  filter: grayscale(1);
  opacity: 0.55;
}
@media (max-height: 500px) and (min-width: 621px) {
  .stage.wide .tray {
    padding: 36px 16px 18px;
    gap: 8px;
  }
  .stage.wide .dice-btn {
    width: 95px;
    height: 95px;
  }
  .stage.wide .info {
    gap: 6px;
  }
  .stage.wide .turn {
    font-size: 20px;
    padding: 8px 13px;
  }
  .stage.wide .hint {
    font-size: 12px;
  }
  .stage.wide .score {
    gap: 5px;
  }
  .stage.wide .chip {
    font-size: 14px;
    min-height: 24px;
    padding: 4px 10px;
  }
  .stage.wide .chip i {
    width: 26px;
    height: 25px;
  }
}
/* Tutorial coach: the space guide talks from a bubble above the board. */
@media (min-width: 1000px) and (min-height: 650px) {
  body.tutorial-active .stage.wide { box-sizing: border-box; padding-top: 130px; }
}
.coach {
  position: fixed;
  z-index: 4;
  transform: translateX(-50%);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 8px;
  border-radius: 22px;
  background: #fffdf9;
  border: 3px solid #8eaad9;
  box-shadow:
    0 8px 0 #d9dbf5,
    0 14px 26px #5b5f9e40;
  color: #343363;
  font-family: var(--font-body);
  pointer-events: auto;
}
.coach canvas {
  width: 82px;
  height: 82px;
  flex: none;
}
@media (max-width: 620px) and (max-height: 700px) {
  body.tutorial-active .stage:not(.wide) {
    transform: translateY(clamp(0px, calc(50dvh - 255px), 56px));
  }
}
@media (max-width: 620px) and (min-height: 601px) and (max-height: 700px) and (orientation: portrait) {
  body.tutorial-active .coach.coach-has-next {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 6px 8px;
  }
  body.tutorial-active .coach.coach-has-next .coach-body { display: contents; }
  body.tutorial-active .coach.coach-has-next canvas { grid-column: 1; grid-row: 2; width: 48px; height: 48px; }
  body.tutorial-active .coach.coach-has-next p { grid-column: 1 / -1; grid-row: 1; }
  body.tutorial-active .coach.coach-has-next .coach-actions {
    grid-column: 2;
    grid-row: 2;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0;
    gap: 6px;
  }
  body.tutorial-active .coach.coach-has-next .coach-actions button { white-space: nowrap; }
}
@media (max-width: 620px) and (max-height: 600px) and (orientation: portrait) {
  body.tutorial-active .stage:not(.wide) {
    box-sizing: border-box;
    padding-top: 95px;
    transform: none;
  }
  body.tutorial-active .coach { padding: 5px 8px; gap: 6px; }
  body.tutorial-active .coach canvas { width: 48px; height: 48px; }
  body.tutorial-active .coach p {
    max-height: 2.6em;
    overflow-y: auto;
    scrollbar-color: #9286c9 #ece9fa;
    scrollbar-width: thin;
  }
  body.tutorial-active .coach-more {
    position: absolute;
    right: 4px;
    top: 4px;
    color: #61538f;
    font: 700 20px/14px var(--font-display);
  }
  body.tutorial-active .coach-actions { margin-top: 0; gap: 4px; flex-wrap: nowrap; }
  body.tutorial-active #coachNext,
  body.tutorial-active #coachSkip {
    flex: 1 1 0;
    min-width: 0;
    padding: 4px;
    font-size: 13px;
    line-height: 1.1;
  }
}
@media (min-width: 700px) and (max-height: 480px) {
  body.tutorial-active .stage.wide { padding-left: 220px; }
  body.tutorial-active .stage.wide .tray { width: 210px; }
  body.tutorial-active .coach {
    max-height: calc(100dvh - 72px);
    overflow: hidden;
    align-items: flex-start;
  }
  body.tutorial-active .coach canvas { width: 42px; height: 42px; }
  body.tutorial-active .coach-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: calc(100dvh - 100px);
  }
  body.tutorial-active .coach p {
    min-height: 0;
    overflow-y: auto;
    scrollbar-color: #9286c9 #ece9fa;
    scrollbar-width: thin;
  }
  body.tutorial-active .coach p::-webkit-scrollbar { width: 7px; }
  body.tutorial-active .coach p::-webkit-scrollbar-track { background: #ece9fa; border-radius: 7px; }
  body.tutorial-active .coach p::-webkit-scrollbar-thumb { background: #8275c0; border-radius: 7px; }
  body.tutorial-active .coach-more {
    align-self: center;
    color: #61538f;
    font: 700 20px/14px var(--font-display);
  }
  body.tutorial-active .coach-actions { flex: none; }
}
.coach-body {
  flex: 1;
  min-width: 0;
}
.coach p {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 600;
}
.coach-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}
#coachNext {
  border: 0;
  border-radius: 999px;
  padding: 8px 18px;
  min-height: 44px;
  background: linear-gradient(#ffd75a, #ffb51e);
  box-shadow: 0 4px 0 #d38a12;
  color: #4a2c00;
  font: 700 15px/1 var(--font-body);
  cursor: pointer;
}
#coachNext:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #d38a12;
}
#coachSkip {
  border: 0;
  background: none;
  color: #625d93;
  font: 600 14px/1 var(--font-body);
  text-decoration: underline;
  cursor: pointer;
  padding: 8px 4px;
  min-height: 44px;
}
.coach-pop {
  animation: coach-pop 0.32s cubic-bezier(0.2, 0.8, 0.25, 1.3);
}
@keyframes coach-pop {
  0% {
    transform: translateX(-50%) scale(0.92);
  }
  60% {
    transform: translateX(-50%) scale(1.03);
  }
  100% {
    transform: translateX(-50%) scale(1);
  }
}
@media (max-width: 480px) {
  .coach p {
    font-size: 14px;
  }
  .coach canvas {
    width: 64px;
    height: 64px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .coach-pop {
    animation: none;
  }
}
#coachCat.talking {
  animation: mia-talk 0.55s ease-in-out infinite;
  transform-origin: 50% 90%;
}
@keyframes mia-talk {
  0%,
  100% {
    transform: rotate(-3deg);
  }
  50% {
    transform: rotate(3deg) translateY(-2px);
  }
}
@media (prefers-reduced-motion: reduce) {
  #coachCat.talking {
    animation: none;
  }
}
/* The guide's hand points to the current tutorial target. */
.tut-paw {
  position: fixed;
  left: 0;
  top: 0;
  width: 76px;
  height: 83px;
  z-index: 4;
  pointer-events: none;
  filter: drop-shadow(0 6px 6px rgba(52, 51, 99, 0.3));
}
.tut-paw img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  animation: paw-tap 0.9s ease-in-out infinite;
  transform-origin: 42% 70%;
}
.tut-paw.point-dice img { rotate: 180deg; }
@keyframes paw-tap {
  0%,
  100% {
    transform: translate(10px, -12px) rotate(-4deg);
  }
  45% {
    transform: translate(0, 0) scale(0.96);
  }
  60% {
    transform: translate(0, 0) scale(0.96);
  }
}
@media (prefers-reduced-motion: reduce) {
  .tut-paw img {
    animation: none;
  }
}
/* End of css/game-03.css */
