* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif;
  color: #12366f;
  background: #eaf8ff;
}

.app-shell {
  width: 100%;
  height: 100dvh;
  display: grid;
  grid-template-columns: 1fr 560px 1fr;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 20% 12%, rgba(98, 205, 255, .24), transparent 24%),
    radial-gradient(circle at 82% 16%, rgba(255, 225, 80, .16), transparent 22%),
    radial-gradient(circle at 50% 42%, #ffffff 0 30%, rgba(255,255,255,.72) 52%, transparent 74%),
    linear-gradient(135deg, rgba(70,170,255,.25) 0 9%, transparent 9%),
    linear-gradient(225deg, rgba(70,170,255,.25) 0 9%, transparent 9%),
    linear-gradient(90deg, #cdecff 0%, #f8fdff 50%, #cdecff 100%);
}

.app-shell::before {
  content: "";
  position: absolute;
  inset: -200px;
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(58, 176, 255, .08) 0,
      rgba(58, 176, 255, .08) 8px,
      transparent 8px,
      transparent 22px
    );
  animation: bgMove 18s linear infinite;
  pointer-events: none;
}

.app-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.95) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(120,220,255,.8) 0 1px, transparent 2px),
    linear-gradient(90deg, transparent 0 18%, rgba(255,255,255,.45) 24% 28%, transparent 36% 100%),
    linear-gradient(270deg, transparent 0 18%, rgba(255,255,255,.45) 24% 28%, transparent 36% 100%);
  background-size: 140px 140px, 90px 90px, 100% 100%, 100% 100%;
  animation: sparkleMove 20s linear infinite;
  opacity: .55;
  pointer-events: none;
}

@keyframes bgMove {
  from { transform: translateY(0); }
  to { transform: translateY(120px); }
}

@keyframes sparkleMove {
  from { transform: translateY(0); }
  to { transform: translateY(100px); }
}

/* 中央 */

.center-panel {
  height: 100dvh;
  display: grid;
  grid-template-rows: 132px 1fr;
  padding: 22px 18px 28px;
  position: relative;
  z-index: 5;
}

.game-title {
  text-align: center;
  position: relative;
}

.game-title::before,
.game-title::after {
  content: "";
  position: absolute;
  top: 12px;
  width: 110px;
  height: 42px;
  border-top: 3px solid rgba(88, 186, 255, .55);
  border-bottom: 3px solid rgba(88, 186, 255, .25);
}

.game-title::before {
  left: 4px;
  transform: skewX(-20deg);
}

.game-title::after {
  right: 4px;
  transform: skewX(20deg);
}

.game-title h1 {
  margin: 0;
  font-size: 38px;
  font-weight: 900;
  letter-spacing: .06em;
  color: #123d80;
  text-shadow:
    0 2px 0 rgba(255,255,255,.95),
    0 0 18px rgba(90, 210, 255, .35);
}

.game-title p {
  margin: 8px 0 0;
  font-size: 17px;
  font-weight: 700;
  color: #23456f;
}

.game-wrap {
  min-height: 0;
  display: grid;
  place-items: center;
}
#game{
  width:100%;
  max-width:480px;
  aspect-ratio:3/4;

  position:relative;
  overflow:hidden;

  border-radius:28px;
  border:10px solid #c8efff;

  background:
  radial-gradient(
      circle at 50% -20%,
      rgba(110,220,255,.25),
      transparent 45%
  ),

  radial-gradient(
      circle at 50% 100%,
      rgba(110,220,255,.18),
      transparent 35%
  ),

  linear-gradient(
      180deg,
      rgba(255,255,255,.95),
      rgba(240,250,255,.98)
  );

  box-shadow:
    0 20px 40px rgba(0,0,0,.15),
    inset 0 0 60px rgba(120,220,255,.08);
}


/* 六角形パターン */
#game::before{
  content:"";

  position:absolute;
  inset:0;

  background-image:
  radial-gradient(
      rgba(70,170,255,.10) 1px,
      transparent 1px
  );

  background-size:35px 35px;

  opacity:.5;

  animation:gridMove 18s linear infinite;

  pointer-events:none;
}


/* 流れる光 */
#game::after{
  content:"";

  position:absolute;
  inset:-50%;

  background:
  linear-gradient(
      120deg,
      transparent 40%,
      rgba(255,255,255,.18) 50%,
      transparent 60%
  );

  animation:shineMove 8s linear infinite;

  pointer-events:none;
}



@keyframes gridMove{

from{
transform:translateY(0);
}

to{
transform:translateY(35px);
}

}


@keyframes shineMove{

from{
transform:
translateX(-120%)
rotate(25deg);
}

to{
transform:
translateX(120%)
rotate(25deg);
}

}
@keyframes shineMove {
  from { transform: translateX(-140%); }
  to { transform: translateX(180%); }
}

#game canvas {
  display: block;
}

/* 左右 */

.side-panel {
  height: 100dvh;
  position: relative;
  overflow: hidden;
  z-index: 3;
}

.side-panel::before {
  content: "";
  position: absolute;
  inset: 28px 42px;
  border: 3px solid rgba(101, 190, 255, .38);
  clip-path: polygon(
    10% 0,
    90% 0,
    100% 10%,
    100% 90%,
    90% 100%,
    10% 100%,
    0 90%,
    0 10%
  );
}

.side-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,.76), transparent 28%),
    radial-gradient(circle at 70% 60%, rgba(115,205,255,.18), transparent 34%);
  pointer-events: none;
}

.side-character {
  position: absolute;
  z-index: 4;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  filter: drop-shadow(0 20px 26px rgba(21, 87, 150, .18));
  animation: floatCharacter 5.5s ease-in-out infinite;
}

.side-character::before {
  content: "";
  position: absolute;
  inset: 12%;
  background: radial-gradient(circle, rgba(91, 214, 255, .32), transparent 70%);
  filter: blur(24px);
  z-index: -1;
  animation: auraPulse 4s ease-in-out infinite;
}

.side-character.kei {
  width: min(34vw, 520px);
  height: min(70vh, 660px);
  left: -4vw;
  top: 145px;
  background-image: url("../assets/images/kei-side.png");
}

.side-character.taruto {
  width: min(30vw, 450px);
  height: min(65vh, 620px);
  right: 3vw;
  top: 128px;
  background-image: url("../assets/images/taruto-side.png");
  animation-delay: -1.5s;
}

@keyframes floatCharacter {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes auraPulse {
  0%, 100% {
    transform: scale(.95);
    opacity: .6;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

/* 名前 */

.side-name {
  position: absolute;
  z-index: 6;
  left: 70px;
  right: 70px;
  bottom: 138px;
  padding: 14px 20px 12px;
  text-align: center;
  background: rgba(255,255,255,.86);
  border-top: 4px solid rgba(102, 188, 255, .9);
  border-bottom: 4px solid rgba(102, 188, 255, .9);
  clip-path: polygon(10% 0, 90% 0, 100% 50%, 90% 100%, 10% 100%, 0 50%);
  box-shadow: 0 10px 24px rgba(40, 118, 190, .15);
}

.side-name span {
  display: block;
  font-size: 30px;
  font-weight: 900;
  color: #4b8ef0;
  line-height: 1.1;
}

.side-name small {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
  color: #173a73;
}

/* アイコン */

.evolution-icons {
  position: absolute;
  z-index: 7;
  left: 52px;
  right: 52px;
  bottom: 42px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.evolution-icons img {
  width: 100%;
  max-width: 78px;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 50%;
  background: rgba(255,255,255,.78);
  box-shadow: 0 8px 18px rgba(34, 118, 190, .16);
  animation: iconFloat 4s ease-in-out infinite;
}

.evolution-icons img:nth-child(2) { animation-delay: -.8s; }
.evolution-icons img:nth-child(3) { animation-delay: -1.6s; }
.evolution-icons img:nth-child(4) { animation-delay: -2.4s; }

@keyframes iconFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.03); }
}

/* SP */

@media (max-width: 960px) {
  .app-shell {
    display: block;
    background:
      radial-gradient(circle at 20% 10%, rgba(92,203,255,.22), transparent 24%),
      radial-gradient(circle at 80% 12%, rgba(255, 222, 95, .18), transparent 22%),
      linear-gradient(180deg, #f8fdff, #e6f6ff);
  }

  .side-panel {
    display: none;
  }

  .center-panel {
    width: 100vw;
    grid-template-rows: 74px 1fr;
    padding: 10px;
  }

  .game-title::before,
  .game-title::after {
    display: none;
  }

  .game-title h1 {
    font-size: 24px;
  }

  .game-title p {
    font-size: 12px;
    margin-top: 4px;
  }

  #game {
    height: min(100%, calc(100dvh - 84px));
    border-width: 6px;
    border-radius: 20px;
  }
}

@media (max-height: 760px) {
  .center-panel {
    grid-template-rows: 92px 1fr;
    padding-top: 12px;
  }

  .game-title h1 {
    font-size: 26px;
  }

  .game-title p {
    font-size: 13px;
  }

  #game {
    height: min(100%, calc(100dvh - 112px));
  }

  .side-character.kei {
    height: min(66vh, 560px);
    top: 105px;
  }

  .side-character.taruto {
    height: min(60vh, 520px);
    top: 100px;
  }

  .side-name {
    bottom: 100px;
  }

  .evolution-icons {
    bottom: 24px;
  }
}