/* Vedia / MiniMax M3.1 マインスイーパー */
body:has(.vms) {
  margin: 0;
  color: #e9f2ee;
  background:
    radial-gradient(circle at 18% 8%, rgba(92, 225, 178, .12), transparent 28rem),
    radial-gradient(circle at 88% 80%, rgba(255, 190, 92, .08), transparent 25rem),
    #0b1217;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body:has(.vms) > header {
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 24px;
  color: #d8e6e0;
  border-bottom: 1px solid rgba(160, 211, 190, .13);
}
body:has(.vms) > header a { color: #8de6c2; }
body:has(.vms) > main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 52px;
  background: transparent;
  border-radius: 0;
}

.vms {
  --vms-accent: #65e6b1;
  --vms-accent-soft: rgba(101, 230, 177, .12);
  --vms-panel: #121c22;
  --vms-panel-2: #18242b;
  --vms-line: rgba(171, 220, 201, .16);
  --vms-muted: #91a8a0;
  --vms-danger: #ff716d;
  --vms-cols: 9;
  color: #e9f2ee;
}

.vms-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.vms-eyebrow {
  margin: 0 0 4px;
  color: var(--vms-accent);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .19em;
}
.vms-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4.5rem);
  line-height: .94;
  letter-spacing: -.055em;
}
.vms-heading h1 span {
  display: block;
  margin-top: 8px;
  color: var(--vms-muted);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .24em;
}
.vms-tag {
  max-width: 15rem;
  margin: 0 0 4px;
  color: #a9bcb5;
  font-size: .88rem;
  text-align: right;
}

.vms-console {
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--vms-line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(20, 32, 39, .97), rgba(12, 20, 25, .97));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}
.vms-toolbar,
.vms-statusbar,
.vms-footer-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.vms-toolbar { margin-bottom: 14px; }
.vms-difficulties { display: flex; flex-wrap: wrap; gap: 8px; }
.vms-difficulty,
.vms-icon-button,
.vms-face {
  font: inherit;
  color: #dceae5;
  border: 1px solid var(--vms-line);
  background: #18242b;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.vms-difficulty {
  display: grid;
  gap: 1px;
  min-width: 108px;
  padding: 8px 13px;
  border-radius: 9px;
  font-size: .82rem;
  font-weight: 750;
  text-align: left;
}
.vms-difficulty span { color: var(--vms-muted); font-size: .67rem; font-weight: 550; }
.vms-difficulty:hover,
.vms-icon-button:hover,
.vms-face:hover { border-color: rgba(101, 230, 177, .52); }
.vms-difficulty:focus-visible,
.vms-icon-button:focus-visible,
.vms-face:focus-visible,
.vms-cell:focus-visible {
  outline: 2px solid var(--vms-accent);
  outline-offset: 2px;
}
.vms-difficulty.is-active {
  color: #07110d;
  border-color: var(--vms-accent);
  background: var(--vms-accent);
}
.vms-difficulty.is-active span { color: rgba(7, 17, 13, .68); }
.vms-icon-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.45rem;
  line-height: 1;
}
.vms-icon-button:active,
.vms-face:active { transform: scale(.94); }

.vms-statusbar {
  padding: 11px 14px;
  border: 1px solid var(--vms-line);
  border-radius: 11px;
  background: #0d161b;
}
.vms-meter { display: flex; align-items: baseline; gap: 9px; }
.vms-meter-label { color: var(--vms-muted); font-size: .65rem; font-weight: 800; letter-spacing: .16em; }
.vms-meter strong {
  min-width: 3ch;
  color: #f4f8f6;
  font: 800 1.18rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.vms-face {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  font-size: 1.45rem;
  line-height: 1;
}
.vms-message {
  min-height: 1.6em;
  margin: 11px 2px 12px;
  color: #aabcb5;
  font-size: .8rem;
}
.vms-message.is-win { color: var(--vms-accent); font-weight: 750; }
.vms-message.is-lose { color: var(--vms-danger); font-weight: 750; }

.vms-board-scroll {
  max-width: 100%;
  overflow-x: auto;
  padding: 10px 10px 13px;
  border: 1px solid var(--vms-line);
  border-radius: 12px;
  background:
    linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent  1px),
    #0a1216;
  background-size: 18px 18px;
  scrollbar-color: #355049 #0a1216;
}
.vms-board {
  display: grid;
  grid-template-columns: repeat(var(--vms-cols), minmax(26px, 1fr));
  min-width: calc(var(--vms-cols) * 30px);
  width: 100%;
  gap: 3px;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.vms-cell {
  position: relative;
  display: grid;
  min-width: 0;
  aspect-ratio: 1;
  place-items: center;
  padding: 0;
  color: #edf5f1;
  border: 1px solid #385047;
  border-top-color: #4d6b5e;
  border-left-color: #4d6b5e;
  border-radius: 4px;
  background: linear-gradient(145deg, #263b35, #1c2d29);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .025), 0 1px 0 rgba(0, 0, 0, .25);
  font: 900 clamp(.72rem, 1.9vw, 1.08rem)/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.vms-cell:hover:not(.is-revealed) { border-color: #65b899; background: #2a433a; }
.vms-cell:active:not(.is-revealed) { transform: translateY(1px); }
.vms-cell.is-revealed {
  border: 1px solid #20302b;
  border-top-color: #20302b;
  border-left-color: #20302b;
  background: #111c20;
  box-shadow: none;
  cursor: default;
}
.vms-cell.is-flag { color: #ff827c; background: #382526; }
.vms-cell.is-question { color: #ffd17d; background: #352f20; }
.vms-cell.is-mine { color: #ff716d; background: #3a1e23; }
.vms-cell.is-wrong { color: #ff716d; background: #321f25; }
.vms-cell.n1 { color: #72baff; }
.vms-cell.n2 { color: #68dfad; }
.vms-cell.n3 { color: #ff7f88; }
.vms-cell.n4 { color: #c99cff; }
.vms-cell.n5 { color: #ffc36e; }
.vms-cell.n6 { color: #6ee7e7; }
.vms-cell.n7 { color: #f2edf8; }
.vms-cell.n8 { color: #cbd5e1; }

.vms-footer-line {
  margin-top: 13px;
  padding: 0 2px;
}
.vms-best,
.vms-safe-note { margin: 0; font-size: .76rem; }
.vms-best { color: #dcebe5; font-weight: 700; }
.vms-safe-note { color: var(--vms-muted); }
.vms-storage-note { margin: 8px 2px 0; color: #ffb9a8; font-size: .76rem; }

.vms-guide {
  margin-top: 22px;
  padding: 20px 22px;
  border: 1px solid var(--vms-line);
  border-radius: 14px;
  background: rgba(15, 25, 30, .72);
}
.vms-guide h2 { margin: 0 0 12px; color: #f1f7f4; font-size: 1.05rem; }
.vms-guide dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 22px; margin: 0; }
.vms-guide dl div { display: grid; gap: 1px; }
.vms-guide dt { color: var(--vms-accent); font-size: .78rem; font-weight: 750; }
.vms-guide dd { margin: 0; color: #aabcb5; font-size: .78rem; }
.vms-guide > p { margin: 14px 0 0; color: var(--vms-muted); font-size: .78rem; }

@media (max-width: 700px) {
  body:has(.vms) > header { padding: 16px; }
  body:has(.vms) > main { margin: 0; padding: 20px 12px 36px; }
  .vms-heading { align-items: flex-start; margin-bottom: 17px; }
  .vms-tag { display: none; }
  .vms-console { padding: 10px; border-radius: 13px; }
  .vms-toolbar { align-items: flex-start; }
  .vms-difficulties { display: grid; grid-template-columns: repeat(3, 1fr); flex: 1; }
  .vms-difficulty { min-width: 0; padding: 7px 8px; font-size: .72rem; }
  .vms-difficulty span { font-size: .61rem; }
  .vms-icon-button { flex: 0 0 40px; width: 40px; height: 40px; }
  .vms-statusbar { padding: 9px 10px; }
  .vms-meter { gap: 5px; }
  .vms-meter-label { font-size: .57rem; }
  .vms-board-scroll { padding: 7px 7px 10px; }
  .vms-guide { padding: 17px; }
  .vms-guide dl { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .vms-difficulty,
  .vms-icon-button,
  .vms-face,
  .vms-cell { transition: none; }
}
