:root {
  --bg: #f5e6d8;
  --ink: #2a1240;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px)
}

@media (prefers-color-scheme:dark) {
  :root:not([data-theme="light"]) {
    --bg: #140622;
    --ink: #fff0e0
  }
}

:root[data-theme="dark"] {
  --bg: #140622;
  --ink: #fff0e0
}

html,
body {
  height: 100%;
  margin: 0
}

body {

  background:
    linear-gradient(rgba(28, 19, 82, 0.10), rgba(28, 19, 82, 0.10)),
    url('bg.png') center center / cover no-repeat;


  color: var(--ink);
  overflow: hidden;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent
}

#wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center
}

#box {
  position: relative;
  width: min(100%, calc(100vh*9/16));
  aspect-ratio: 9/16;
  max-height: 100%;
  font-family: Georgia, "Times New Roman", serif
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 18px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .4)
}

.scr {
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: radial-gradient(ellipse at 50% 85%, rgba(255, 122, 89, .55), transparent 60%), radial-gradient(ellipse at 50% 0, rgba(255, 79, 160, .3), transparent 60%), linear-gradient(#4a1a7a, #140622);
  color: #fff0e0;
  transition: opacity .3s
}

.dim {
  background: rgba(20, 6, 34, .84)
}

.hide {
  opacity: 0;
  pointer-events: none;
  visibility: hidden
}

.ttl {
  font-size: clamp(38px, 13vw, 50px);
  font-weight: bold;
  letter-spacing: 1px;
  background: linear-gradient(#fff, #ffd27a 50%, #ff7a59);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 14px rgba(255, 159, 67, .85)) drop-shadow(0 3px 0 rgba(40, 0, 30, .8))
}

.pl {
  position: relative;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff 0, #ffd9a8 24%, #e8741e 62%, #4a1a0a 100%);
  box-shadow: 0 0 40px rgba(255, 159, 67, .8), inset -8px -10px 16px rgba(40, 0, 50, .55);
  animation: fl 1.2s ease-in-out infinite
}

.pl:before,
.pl:after {
  content: "";
  position: absolute;
  top: 28px;
  width: 11px;
  height: 15px;
  border-radius: 50%;
  background: #fff
}

.pl:before {
  left: 20px
}

.pl:after {
  left: 42px
}

@keyframes fl {

  0%,
  100% {
    transform: translateY(-14px) scaleY(1.06)
  }

  50% {
    transform: translateY(14px) scaleY(.94)
  }
}

#bar {
  width: 60%;
  height: 14px;
  border-radius: 8px;
  border: 2px solid #ffc27a;
  overflow: hidden;
  background: rgba(0, 0, 0, .3);
  box-shadow: 0 0 14px rgba(255, 159, 67, .4)
}

#bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ff7a59, #ffe14d);
  box-shadow: 0 0 10px #ffe14d
}

#pt {
  font-size: 17px
}

.panel {
  width: 86%;
  max-height: 90%;
  overflow: auto;
  background: linear-gradient(#3a1a66, #1e0a38);
  border: 2px solid #ffc27a;
  border-radius: 22px;
  padding: 20px 18px;
  box-sizing: border-box;
  box-shadow: 0 0 30px rgba(255, 159, 67, .35), inset 0 2px 0 rgba(255, 255, 255, .18)
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 28px;
  text-align: center;
  text-shadow: 0 0 14px #ff9f43
}

.row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 10px 0;
  font-size: 16px;
  line-height: 1.35
}

.row i {
  font-style: normal;
  font-size: 24px;
  min-width: 30px;
  text-align: center
}

.go {
  display: block;
  margin: 16px auto 0;
  padding: 11px 34px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(#fff2a0, #ffe14d 55%, #f0b92a);
  color: #3a2600;
  font: bold 18px Georgia, serif;
  cursor: pointer;
  box-shadow: 0 5px 0 #b58a2a, 0 10px 18px rgba(0, 0, 0, .4), inset 0 3px 0 rgba(255, 255, 255, .6)
}

.go:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #b58a2a
}

#tb {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
  z-index: 4
}

#tb button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #ffc27a;
  background: radial-gradient(circle at 35% 28%, #ffb36b, #c2541e 60%, #3a1006);
  box-shadow: 0 3px 0 #1a0620, 0 0 12px rgba(255, 159, 67, .5), inset 0 2px 3px rgba(255, 255, 255, .45);
  color: #fff;
  font: bold 18px Georgia, serif;
  cursor: pointer;
  padding: 0
}

#tb button:active {
  transform: translateY(2px)
}

@media (prefers-reduced-motion:reduce) {
  .pl {
    animation: none
  }
}