/* =========================
   touchpractice.css
   ========================= */

/* ---- Reset-ish ---- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body{
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
               Arial, "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  color: rgba(255,255,255,.92);
  background:
    radial-gradient(1200px 700px at 18% 10%, rgba(96,165,250,.18), transparent 60%),
    radial-gradient(900px 520px at 82% 40%, rgba(167,139,250,.16), transparent 60%),
    linear-gradient(180deg, #0b1220, #070b14 55%, #060910);
}

/* Skip link */
.skip-link{
  position: absolute;
  left: -9999px;
  top: 10px;
  padding: 10px 12px;
  background: #fff;
  color: #111;
  border-radius: 10px;
  z-index: 9999;
}
.skip-link:focus{
  left: 10px;
  outline: none;
}

/* ---- Layout ---- */
.container{
  width: min(1020px, calc(100% - 32px));
  margin: 0 auto;
}

.main{
  padding: 18px 0 36px;
}

/* ---- Header ---- */
.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 16, 28, .78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.brand{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark{
  font-size: 22px;
  line-height: 1;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
}

.brand-text{ min-width: 0; }

.brand-title{
  margin: 0;
  font-size: 16px;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub{
  margin-top: 2px;
  font-size: 12px;
  color: rgba(255,255,255,.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-links{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* header buttons */
.mouse-link,
.site-link{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
}

.mouse-link:hover,
.site-link:hover{
  background: rgba(255,255,255,.10);
}

.mouse-link:active,
.site-link:active{
  transform: translateY(1px);
}

/* ---- Screen ---- */
.screen{ display: block; }
.is-hidden{ display: none !important; }

/* ---- Cards ---- */
.card{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.25);
  overflow: hidden;
  margin: 14px 0;
}

.card-head{
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.card-body{
  padding: 14px 16px;
}

.h2{
  margin: 0;
  font-size: 16px;
  letter-spacing: .01em;
}

.lead{
  margin: 0 0 10px;
  line-height: 1.6;
  color: rgba(255,255,255,.90);
}

.muted{
  color: rgba(255,255,255,.70);
}

.small{
  font-size: 12px;
}

.list{
  margin: 10px 0 0;
  padding-left: 18px;
  line-height: 1.7;
}

/* Intro card a */
a{
  color: rgba(255,255,255,.92);
}
a:hover{ opacity: .92; }

/* ---- Menu ---- */
.menu-home{
  display: grid;
  gap: 10px;
}

.btn{
  appearance: none;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: .01em;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 12px 30px rgba(0,0,0,.20);
}

.btn:hover{
  background: rgba(255,255,255,.10);
}

.btn:active{
  transform: translateY(1px);
}

.stage-btn{
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
}

.btn-ghost{
  background: rgba(255,255,255,.05);
}

/* ---- Stage / play card ---- */
.card-play .card-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.badge{
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.20);
  color: rgba(255,255,255,.88);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 6px;
}

.stats{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stat{
  min-width: 76px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  text-align: center;
}

.stat-label{
  font-size: 11px;
  color: rgba(255,255,255,.68);
  font-weight: 800;
}

.stat-value{
  margin-top: 2px;
  font-size: 16px;
  font-weight: 1000;
  color: rgba(255,255,255,.92);
}

/* instruction */
.instruction{
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  color: rgba(255,255,255,.92);
  font-weight: 900;
  line-height: 1.5;
}

/* play area */
.play-wrap{
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  overflow: hidden;
}

.play-area{
  position: relative;
  width: 100%;
  height: clamp(320px, 44vh, 520px);
  overflow: hidden;
  touch-action: none; /* important for gestures */
  background:
    radial-gradient(900px 520px at 30% 20%, rgba(255,255,255,.06), transparent 62%),
    radial-gradient(700px 460px at 70% 70%, rgba(255,255,255,.05), transparent 60%),
    linear-gradient(180deg, rgba(0,0,0,.10), rgba(0,0,0,.15));
}

/* ★総合のバナーと重ならないための上余白 */
.play-area.has-top-badge{
  padding-top: 56px;
}

/* Top badge created by JS */
.play-area .top-badge{
  z-index: 5;
}

/* floating score text */
.floating{
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.30);
  color: rgba(255,255,255,.95);
  font-weight: 1000;
  font-size: 13px;
  pointer-events: none;
  animation: floatUp .8s ease-out forwards;
  box-shadow: 0 18px 40px rgba(0,0,0,.30);
}

@keyframes floatUp{
  0%   { opacity: 0; transform: translate(-50%, -50%) translateY(8px) scale(.98); }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) translateY(-18px) scale(1.02); }
}

/* target circle */
.target{
  position: absolute;
  border-radius: 999px;
  border: 2px solid rgba(96,165,250,.85);
  background: rgba(96,165,250,.18);
  box-shadow: 0 18px 40px rgba(0,0,0,.22);
  cursor: pointer;
  touch-action: none;
}

/* swipe card */
.card-swipe{
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(320px, calc(100% - 56px));
  height: 150px;
  transform: translate(-50%, -50%);
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.07);
  box-shadow: 0 22px 60px rgba(0,0,0,.28);
  display: grid;
  place-items: center;
  font-weight: 1000;
  letter-spacing: .02em;
  color: rgba(255,255,255,.92);
  user-select: none;
  touch-action: none;
}

/* pinch / slide box */
.pinch-box{
  position: absolute;
  left: 50%;
  top: 50%;
  width: 220px;
  height: 220px;
  transform: translate(-50%, -50%);
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  box-shadow: 0 20px 55px rgba(0,0,0,.28);
  user-select: none;
  touch-action: none;
}

/* play footer buttons row */
.play-footer{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* details */
.help{
  margin-top: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  overflow: hidden;
}
.help summary{
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 900;
  color: rgba(255,255,255,.88);
}
.help-body{
  padding: 10px 12px 12px;
  color: rgba(255,255,255,.80);
}

/* ---- Home footer (if you keep it in HTML) ---- */
.home-footer{
  margin: 18px 0 28px;
  text-align: center;
  color: rgba(255,255,255,.65);
  font-size: 12px;
}
.home-footer a{
  color: rgba(255,255,255,.85);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.home-footer .sep{ opacity:.45; margin: 0 8px; }

/* ---- Responsive ---- */
@media (max-width: 720px){
  .container{
    width: min(1020px, calc(100% - 22px));
  }

  .header-inner{
    padding: 12px 0;
    gap: 12px;
  }

  .brand-title{ font-size: 14px; }
  .brand-sub{ font-size: 11px; }

  .mouse-link,
  .site-link{
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }

  .card-head,
  .card-body{
    padding: 12px 12px;
  }

  .stats{
    gap: 8px;
  }

  .stat{
    min-width: 70px;
    padding: 7px 9px;
  }

  .play-area{
    height: clamp(300px, 46vh, 520px);
  }

  .btn{
    padding: 12px 12px;
  }
}

@media (prefers-reduced-motion: reduce){
  .floating{ animation: none; opacity: 1; }
  .btn:active{ transform: none; }
}
