:root{
      --bg:#0b1220;
      --card:rgba(255,255,255,0.06);
      --text:rgba(255,255,255,0.92);
      --muted:rgba(255,255,255,0.65);
      --border:rgba(255,255,255,0.14);
      --btn:rgba(255,255,255,0.10);
      --btnHover:rgba(255,255,255,0.16);
    }
    *{ box-sizing:border-box; }
    html,body{ height:100%; }
    body{
      margin:0;
      font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
      background:
        radial-gradient(1200px 700px at 20% 10%, rgba(122,167,255,0.22), transparent 55%),
        radial-gradient(900px 600px at 90% 30%, rgba(151,255,209,0.14), transparent 60%),
        var(--bg);
      color:var(--text);
      min-height:100dvh;
      display:grid;
      place-items:center;
      padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right))
               max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
      -webkit-text-size-adjust: 100%;
    }

    .container{ width:min(900px, 100%); }

    header{
      display:flex;
      align-items:baseline;
      justify-content:space-between;
      gap:14px;
      margin-bottom:12px;
      flex-wrap:wrap;
    }
    h1{
      font-size: clamp(22px, 4.5vw, 34px);
      margin:0;
      letter-spacing:0.02em;
    }
    .hint{
      color:var(--muted);
      font-size:13px;
      line-height:1.4;
      margin:0;
      text-align:left;
    }

    .card{
      background:var(--card);
      border:1px solid var(--border);
      border-radius:18px;
      padding:16px;
      box-shadow:0 10px 30px rgba(0,0,0,0.25);
      backdrop-filter: blur(10px);
    }

    .row{
      display:grid;
      grid-template-columns:1fr;
      gap:10px;
      margin-top:10px;
    }
    .inputWrap{ display:flex; gap:10px; align-items:center; }

    /* iOSが勝手にズームしにくい：16px以上 */
    input[type="text"]{
      width:100%;
      padding:14px 12px;
      border-radius:12px;
      border:1px solid var(--border);
      background: rgba(0,0,0,0.18);
      color:var(--text);
      outline:none;
      font-size:16px;
    }
    input[type="text"]::placeholder{ color: rgba(255,255,255,0.45); }

    .buttons{
      display:flex;
      gap:10px;
      flex-wrap:wrap;
      margin-top:14px;
    }

    /* タップしやすいサイズ */
    button{
      appearance:none;
      border:1px solid var(--border);
      background:var(--btn);
      color:var(--text);
      padding:12px 14px;
      border-radius:12px;
      cursor:pointer;
      font-size:16px;
      min-height:44px;
      min-width:120px;
      transition: transform 0.03s ease, background 0.15s ease;
      user-select:none;
      touch-action: manipulation;
    }
    button:hover{ background:var(--btnHover); }
    button:active{ transform: translateY(1px); }
    button.primary{
      border-color: rgba(122,167,255,0.55);
      background: rgba(122,167,255,0.18);
    }
    button.primary:hover{ background: rgba(122,167,255,0.26); }

    /* スマホは横いっぱいで押しやすく */
    @media (max-width: 480px){
      .buttons button{ flex: 1 1 auto; min-width: 0; }
      .hint{ width:100%; }
    }

    .error{
      margin-top:10px;
      color:#ffb4b4;
      font-size:14px;
      min-height:1.2em;
    }

    .screen{ display:none; }
    .screen.active{ display:block; }

    .resultCenter{
      min-height:62dvh;
      display:grid;
      place-items:center;
      text-align:center;
      padding:16px 8px;
    }
    .resultBox{
      width:min(820px, 100%);
      padding: clamp(18px, 4vw, 28px);
      border-radius:22px;
      border:1px solid rgba(255,255,255,0.16);
      background: rgba(0,0,0,0.16);
      box-shadow: 0 18px 50px rgba(0,0,0,0.28);
    }

    .picked{
      font-size: clamp(24px, 7vw, 44px);
      font-weight: 800;
      line-height: 1.2;
      margin: 0 0 14px 0;
      word-break: break-word;
      overflow-wrap: anywhere;
    }
    .message{
      font-size: clamp(18px, 4.8vw, 26px);
      font-weight: 700;
      line-height: 1.5;
      margin: 0;
      color: rgba(255,255,255,0.9);
    }

    .footerBtn{ margin-top:18px; display:flex; justify-content:center; }
    .smallNote{ margin-top:10px; font-size:12px; color:var(--muted); }

/* ===== 共通固定フッター ===== */
:root {
  --sakurayama-footer-height: 56px;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(var(--sakurayama-footer-height) + 14px) !important;
  box-sizing: border-box;
}

.site-footer {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 2147483000 !important;
  width: 100% !important;
  min-height: var(--sakurayama-footer-height) !important;
  margin: 0 !important;
  padding: 6px 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  text-align: center !important;
  background: rgba(248, 251, 255, 0.97) !important;
  border-top: 1px solid rgba(21, 101, 192, 0.28) !important;
  box-shadow: 0 -4px 14px rgba(15, 23, 42, 0.10) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.site-footer .sakurayama-copyright {
  margin: 0 !important;
  color: #1565c0 !important;
  font-size: 1.02rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
}

.site-footer .sakurayama-copyright a {
  color: #1565c0 !important;
  text-decoration: none !important;
  font-weight: 700 !important;
}

.site-footer .sakurayama-copyright a:hover,
.site-footer .sakurayama-copyright a:focus-visible {
  color: #0d47a1 !important;
  text-decoration: underline !important;
}

@media (max-width: 480px) {
  :root {
    --sakurayama-footer-height: 52px;
  }
  .site-footer .sakurayama-copyright {
    font-size: 0.94rem !important;
  }
}

@media print {
  body {
    padding-bottom: 0 !important;
  }
  .site-footer {
    display: none !important;
  }
}
