html {
  margin: 0;
  background: #081b2b;
}

body {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  box-sizing: border-box;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
  overflow: hidden;
  overscroll-behavior: none;
}

#GameDiv {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  background: #000;
}

#Cocos3dGameContainer, #GameCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

#GameCanvas { touch-action: none; }

#ctv-fishing-hint {
  position: absolute;
  z-index: 3;
  inset-inline: 0;
  bottom: clamp(88px, 25%, 206px);
  box-sizing: border-box;
  width: max-content;
  max-width: min(330px, calc(100% - 32px));
  margin-inline: auto;
  padding: 10px 12px 7px;
  border: 1px solid #b6e4f265;
  border-radius: 12px;
  background: #0d2b39ed;
  color: #f5fbff;
  box-shadow: 0 4px 16px #071c2a65;
  font: 600 14px/1.4 system-ui, sans-serif;
  text-align: center;
  pointer-events: none;
}

#ctv-fishing-hint[data-stage="fight"] {
  top: clamp(54px, 12%, 104px);
  bottom: auto;
}

#ctv-fishing-hint p { margin: 0; }
#ctv-fishing-hint div { margin-top: 4px; }

#ctv-fishing-hint button {
  min-height: 36px;
  padding: 5px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #c4e8f5;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  pointer-events: auto;
}

#ctv-fishing-hint button:first-child {
  border-color: #ffdf8f;
  background: linear-gradient(#ffe39a, #ffb94f);
  color: #352408;
}

.river-dialogue {
  position: absolute;
  z-index: 2;
  top: 22%;
  inset-inline: 0;
  margin-inline: auto;
  width: max-content;
  max-width: min(328px, calc(100% - 24px));
  pointer-events: none;
}

.river-dialogue p {
  margin: 0;
  color: #f4fcfb;
  font: 600 14px/1.35 system-ui, sans-serif;
  text-align: center;
  paint-order: stroke fill;
  -webkit-text-stroke: 2px #122338;
  text-shadow: 0 1px 3px rgb(8 20 34 / 75%);
}

.river-dialogue strong {
  margin-right: 0.55em;
  color: #f4d68d;
}

@media (max-width: 360px) {
  .river-dialogue p { font-size: 13px; }
}



dialog.ctv-replay { max-width: min(94vw, 760px); max-height: 96dvh; box-sizing: border-box; padding: 10px; border: 0; border-radius: 12px; background: #102e3c; color: white; }
.ctv-replay::backdrop { background: rgb(0 0 0 / 77%); }
.ctv-replay video { display: block; max-width: 100%; max-height: 78dvh; margin: auto; }
.ctv-replay div { display: flex; justify-content: center; gap: 10px; padding-top: 8px; }
.ctv-replay :is(a,button) { padding: 10px 16px; border: none; border-radius: 7px; color: white; background: #235d72; font: 600 15px system-ui; text-decoration: none; cursor: pointer; }
