/*基本設定*/
:root {
  --bg: #ddffdd;
  --p: #004400;
  --a: #ff3333;
  --b: #000099;
  --black: #333333;
  --box: #ffffcc;
  --btnbg: #ffffff;
  --btnbd: #999999;
}

body {
  background-color: var(--bg);
}
.main {
  padding-top: 1.0rem;
  touch-action: manipulation;
}
.hidden {
  visibility: hidden;
}

p {
  color: var(--p);
}
b, .b, strong .strong {
  color: var(--b);
}

.stage_box {
  display: flex;
  justify-content: center;
  margin: 1.0rem auto 0;
  gap: 0.75rem;
}
.stage {
  width: 5.0rem;
  height: auto;
  aspect-ratio: 1/1;
  box-sizing: border-box;
  border: solid 3px var(--btnbd);
  background-color: var(--black);
}
.stage.tried {
  background-color: var(--btnbg);
}
.stage.seeing {
  background-color: #66ff66;
}

.view {
  position: relative;
  width: min(90vw, 640px);
  margin: 0 auto;
  overscroll-behavior: contain;
}
canvas#board {
  width: 100%;
  height: 100%;
  display: block;
  background: var(--board);
  border-radius: 1.2rem;
  cursor: pointer;
  touch-action: none;
}
html.no-ptr, body.no-ptr { overscroll-behavior-y: none; }
img.swipe {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(200px, 55%);
  height: auto;
  pointer-events: none;
  z-index: 3;
}
.correct {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60%;
  height: auto;
  transform: translate(-50%, -50%);
  pointer-events: none;
  aspect-ratio: 1/1;
  border-radius: 50%;
  border: 3.0rem solid #ff3333;
}

.wiggle {
  animation: swipe-wiggle 0.8s ease-in-out infinite;
}
@keyframes swipe-wiggle {
  0%, 100% { transform: translate(-50%, -50%) translateX(-12px); }
  50%  { transform: translate(-50%, -50%) translateX( 12px); }
}

.slider {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none
}

.status {
  align-self: flex-start;
  margin: 10px;
  padding: .3rem .6rem;
  background: #111827cc;
  color: #e5e7eb;
  border: 1px solid #1f2937;
  border-radius: 10px;
  font-size: .95rem
}

.controls {
  display: flex;
  justify-content: center;
  width: 100%;
  align-self: flex-end;
  margin: 0;
  gap: 1.5rem;
  pointer-events: auto
}
button {
  width: auto;
  min-width: 6.0rem;
  height: 5.0rem;
  margin: 0;
  padding: 0 1.0rem;
  background: var(--black);
  color: var(--btnbg);
  font-size: 2.4rem;
  border: none;
  text-align: center;
  cursor: pointer;
}
button.reset_btn {
  aspect-ratio: 5/2;
}
button:active {
  margin: 0.3rem 0 -0.3rem;
}

.rule_status {
  width: min(90vw, 640px);
  margin: 3.0rem auto;
  padding: 1.0rem;
  background: #ffffff;
  text-align: center;
  font-size: 2.0rem;
}

.clear_modal {
  display: flex;
  position: relative;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 420px;
  max-width: 90%;
  height: auto;
  aspect-ratio: 16/9;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  background-color: rgba(255, 255, 255, 0.90);
  box-sizing: border-box;
  border: solid 0.5rem #ff7766;
  border-radius: 1.5rem;
  z-index: 100;
  font-size: 7.2rem;
  font-weight: bold;
  color: #ff7766;
}
.batsu {
  display: block;
  position: absolute;
  width: 3.0rem;
  height: 3.0rem;
  top: 0.5rem;
  right: 0.5rem;
  cursor: pointer;
}
.batsu::before, .batsu::after {
  content: "";
  position: absolute;
  right: 1.2rem;
  width: 0.5rem;
  height: 3.0rem;
  background: #333333;
  border-radius: 0.25rem;
}
.batsu::before {
  transform: rotate(45deg);
}
.batsu::after {
  transform: rotate(-45deg);
}
@media screen and (max-width: 640px) {
  .clear_modal {
    font-size: 6.0rem;
  }
}