@import url('style-v3.css');

.touch-controls { display: none; }

.mobile-orientation-note {
  display: none;
  position: absolute;
  z-index: 5;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 10px;
  color: #cbd4f2;
  background: rgba(5, 8, 20, .75);
  border: 1px solid rgba(255,255,255,.14);
  font-size: 9px;
  white-space: nowrap;
  pointer-events: none;
}

.mobile-single-mode .mode-switch { grid-template-columns: 1fr; }
.mobile-single-mode .mode-option[data-mode="versus"] { display: none; }

.mobile-single-mode .game-wrap.mobile-playing .touch-controls {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: 7px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 10px;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.touch-group { display: grid; gap: 6px; pointer-events: none; }
.touch-movement { grid-template-columns: repeat(3, 48px); grid-template-rows: repeat(2, 48px); }
.touch-attacks { grid-template-columns: repeat(2, 54px); grid-template-rows: repeat(2, 54px); }

.touch-button {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 0;
  color: #eef2ff;
  background: rgba(12, 17, 39, .7);
  border: 2px solid rgba(194, 211, 255, .48);
  border-radius: 50%;
  box-shadow: 0 3px 0 rgba(0,0,0,.45), inset 0 0 16px rgba(87,115,201,.2);
  font: 900 16px "Noto Sans SC", sans-serif;
  pointer-events: auto;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.touch-button small { display: block; font-size: 8px; color: #9ba8ce; line-height: 1; }
.touch-button.active, .touch-button:active { transform: translateY(2px); border-color: #ffffff; background: rgba(53, 89, 157, .85); box-shadow: 0 1px 0 rgba(0,0,0,.5), 0 0 14px rgba(87,210,255,.55); }
.touch-left { grid-column: 1; grid-row: 2; }
.touch-right { grid-column: 2; grid-row: 2; }
.touch-jump { grid-column: 2; grid-row: 1; color: #6de5ff; }
.touch-guard { grid-column: 3; grid-row: 2; color: #8ef1ff; }
.touch-hand { grid-column: 1; grid-row: 1; color: #ffd166; }
.touch-kick { grid-column: 2; grid-row: 1; color: #ff7d8d; }
.touch-ranged { grid-column: 2; grid-row: 2; color: #70e7ff; }
.touch-charge-hint { grid-column: 1; grid-row: 2; display: grid; place-items: center; color: #7f8bab; font-size: 8px; text-align: center; }

@media (pointer: coarse), (max-width: 820px) {
  body { overscroll-behavior: none; }
  .mobile-single-mode .p2-card { display: none; }
  .mobile-single-mode .instructions { grid-template-columns: 1fr; }
  .mobile-single-mode .stage-card { grid-column: 1; grid-row: 1; min-height: 35px; }
  .mobile-single-mode .p1-card { grid-column: 1; }
  .mobile-single-mode .footer-note { font-size: 9px; }
}

@media (orientation: portrait) and (max-width: 820px) {
  .mobile-single-mode .game-wrap.mobile-playing .mobile-orientation-note { display: block; }
  .mobile-single-mode .game-wrap.mobile-playing .touch-controls { padding: 0 5px; bottom: 4px; }
  .touch-movement { grid-template-columns: repeat(3, 40px); grid-template-rows: repeat(2, 40px); }
  .touch-attacks { grid-template-columns: repeat(2, 45px); grid-template-rows: repeat(2, 45px); }
  .touch-button { font-size: 13px; border-width: 1px; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .shell { width: 100%; padding: 3px 8px; }
  .masthead, .instructions, .footer-note { display: none; }
  .game-wrap { width: min(100%, calc(100vh * 16 / 9)); margin: auto; }
  .touch-movement { grid-template-columns: repeat(3, 46px); grid-template-rows: repeat(2, 46px); }
  .touch-attacks { grid-template-columns: repeat(2, 51px); grid-template-rows: repeat(2, 51px); }
}
