@charset "UTF-8";
:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  --green: #227c78;
  --muted: #64707d;
  --line: #cbd3dc;
  --cell: 34px;
  --number-size: 20px;
  color: #17212b;
  background: #eef2f6;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #eef2f6 0%, #f8fafc 55%, #edf0f4 100%);
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
button:hover {
  filter: brightness(0.97);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #227c7880;
  outline-offset: 2px;
}
a {
  color: inherit;
  text-decoration: none;
}
[hidden] {
  display: none !important;
}
.shell {
  width: min(1600px, calc(100% - 32px));
  min-height: calc(100dvh - 24px);
  margin: 12px auto;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
}
.header,
.control-strip,
.game-card {
  border: 1px solid #17212b1a;
  background: #ffffffed;
  box-shadow: 0 10px 32px #17212b0a;
  border-radius: 8px;
}
.header {
  min-height: 70px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 26px;
  font-weight: 800;
}
.brand-symbol {
  font-size: 42px;
  color: var(--green);
  line-height: 1;
}
.brand small {
  display: block;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  margin-top: 1px;
}
.header-actions {
  display: flex;
  gap: 9px;
  align-items: center;
}
.account {
  max-width: 220px;
  padding: 8px 16px;
  border: 1px solid #17212b24;
  background: #fff;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quiet {
  padding: 8px 13px;
  color: #526370;
  font-size: 14px;
}
.restart {
  height: 44px;
  width: 48px;
  background: #227c78;
  color: #fff;
  font-size: 29px;
  font-weight: 600;
}
.control-strip {
  padding: 11px 13px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
}
.levels {
  display: grid;
  grid-template-columns: repeat(4, minmax(64px, 1fr));
  border: 1px solid #17212b24;
  border-radius: 8px;
  padding: 4px;
  background: #eef2f6;
}
.levels button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--muted);
  border: 0;
}
.levels button[aria-pressed="true"] {
  background: #fff;
  color: #145c59;
  box-shadow: 0 3px 12px #17212b15;
  font-weight: 700;
}
.dashboard {
  display: flex;
  gap: 10px;
}
.dashboard > div {
  height: 46px;
  min-width: 116px;
  display: flex;
  gap: 13px;
  align-items: center;
  justify-content: space-between;
  padding: 0 11px;
  border: 1px solid #17212b24;
  border-radius: 8px;
  background: #fff;
}
.stat-label {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.dashboard strong {
  font-size: 19px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.touch-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.input-modes {
  display: flex;
  border: 1px solid #17212b24;
  border-radius: 8px;
  padding: 3px;
  background: #eef2f6;
  gap: 3px;
}
.input-modes button {
  min-height: 38px;
  padding: 5px 12px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.input-modes button[aria-pressed="true"] {
  background: var(--green);
  color: #fff;
}
.zoom-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
select {
  min-height: 44px;
  border: 1px solid #cbd3dc;
  border-radius: 7px;
  background: #fff;
  color: #455866;
  padding: 0 8px;
  font-size: 13px;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) 304px;
  gap: 14px;
  align-items: stretch;
}
.game-card {
  min-width: max-content;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}
.status {
  min-height: 36px;
  margin: 0;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #17212b;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}
.board-scroll {
  overflow: visible;
  max-height: none;
  border: 1px solid #17212b24;
  border-radius: 8px;
  background: #aeb8c5;
  padding: 10px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: max-content;
}
.board {
  width: max-content;
  flex-shrink: 0;
  margin: auto;
  display: grid;
  gap: 3px;
  padding: 3px;
  border-radius: 6px;
  background: #8f9baa;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.cell {
  width: var(--cell);
  height: var(--cell);
  min-height: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: linear-gradient(145deg, #eef3f7, #d6dce4);
  color: #17212b;
  box-shadow:
    inset 2px 2px 0 #ffffffd9,
    inset -2px -2px 0 #5b677540;
  font-size: var(--number-size);
  font-weight: 800;
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1;
  padding: 0;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
.cell:hover {
  filter: brightness(1.04);
}
.cell.pressing {
  background: #bddcdb;
  transform: translateY(1px);
}
.cell.open {
  background: #f7f9fb;
  box-shadow: inset 0 0 0 1px #17212b14;
}
.cell.flag {
  color: #d84f3f;
  background: #fff5dc;
}
.cell.exploded {
  background: #d84f3f;
  color: #fff;
}
.cell.wrong {
  background: #fff5d8;
  color: #b33d32;
}
.cell[data-number="1"] {
  color: #1f6fd1;
}
.cell[data-number="2"] {
  color: #1d7e42;
}
.cell[data-number="3"] {
  color: #d84f3f;
}
.cell[data-number="4"] {
  color: #6f42c1;
}
.cell[data-number="5"] {
  color: #a23730;
}
.cell[data-number="6"] {
  color: #0f766e;
}
.cell[data-number="7"] {
  color: #17212b;
}
.cell[data-number="8"] {
  color: #6f7b88;
}
.board-caption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  padding: 0 2px;
  line-height: 18px;
}
.safe-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 6px;
}
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.side-card {
  border: 1px solid #17212b1a;
  border-radius: 8px;
  padding: 15px;
  background: #ffffffed;
}
.leaderboard {
  flex: 1;
  min-height: 190px;
  display: flex;
  flex-direction: column;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.section-head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
}
.section-head h2 span {
  font-size: 10px;
  letter-spacing: 1px;
  color: #8a96a0;
  margin-left: 7px;
  font-weight: 500;
}
.section-head button {
  min-height: 32px;
  font-size: 23px;
  padding: 0 5px;
}
.side-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0 12px;
}
.rank-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 300px;
  overflow: auto;
  flex: 1;
}
.rank-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 47px;
  border-bottom: 1px solid #edf0f3;
  font-size: 14px;
}
.position {
  font-size: 13px;
  font-weight: 800;
  color: #8996a2;
  width: 20px;
}
.rank-list li:first-child .position {
  color: #b78923;
}
.rank-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  font-size: 21px;
}
.rank-name {
  flex: 1;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-time {
  color: #227c78;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rank-list .empty {
  min-height: 100px;
  justify-content: center;
  font-size: 13px;
  color: #7d8b97;
  border: 0;
}
.rank-note {
  margin: 12px 0 0;
  padding-top: 11px;
  border-top: 1px solid #e9eef2;
  font-size: 11px;
  color: #748390;
  line-height: 1.8;
}
.guide-card {
  background: #eef7f6;
  border-color: #d3e3e2;
}
.mini-label {
  font-size: 11px;
  color: #638885;
}
.guide-card h2 {
  font-size: 17px;
  margin: 9px 0;
  font-weight: 700;
}
.guide-card p {
  font-size: 13px;
  color: #5b7978;
  line-height: 1.75;
  margin: 0 0 12px;
}
.key-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.key-hints span {
  background: #fff9;
  border-radius: 5px;
  padding: 5px 6px;
  font-size: 10px;
  color: #6b8683;
}
.key-hints b {
  color: #386d68;
  margin-left: 3px;
  font-weight: 600;
}
.personal-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px;
  font-size: 12px;
  color: #788791;
}
.personal-card strong {
  font-size: 12px;
  color: #387b70;
  font-weight: 600;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 11px;
  color: #7d8995;
  padding: 0 3px;
  min-height: 18px;
}
.primary {
  background: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  white-space: nowrap;
}
.primary:hover {
  background: #196460;
}
.full {
  width: 100%;
}
.result {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 50px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 16px 20px;
  border: 1px solid #b7d6d0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 40px #1c3d4026;
}
.result strong {
  font-size: 19px;
}
.result p {
  margin: 5px 0 0;
  font-size: 12px;
  color: #5f7a75;
  line-height: 1.8;
}
dialog {
  max-width: 460px;
  width: calc(100% - 32px);
  max-height: 85dvh;
  overflow: auto;
  border: 1px solid #ccd7dd;
  border-radius: 12px;
  padding: 24px;
  color: #253a47;
  box-shadow: 0 24px 100px #1e344540;
}
dialog::backdrop {
  background: #21334166;
  backdrop-filter: blur(3px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.dialog-head h2 {
  font-size: 21px;
  font-weight: 750;
  margin: 0;
}
dialog p,
.help-list {
  font-size: 14px;
  line-height: 1.8;
  color: #657683;
}
.help-list {
  padding-left: 20px;
}
.help-list li {
  margin: 10px 0;
}
.help-list b {
  color: #2f5560;
}
form {
  display: grid;
  gap: 15px;
  margin: 18px 0;
}
label {
  display: grid;
  gap: 7px;
  font-size: 14px;
  color: #556d7c;
}
input {
  width: 100%;
  font-size: 16px;
  color: #263e4d;
  padding: 11px;
  border: 1px solid #cbd7df;
  border-radius: 7px;
  background: #f9fbfc;
}
.auth-tabs {
  display: flex;
  gap: 18px;
  margin-top: 20px;
  border-bottom: 1px solid var(--line);
}
.auth-tabs button {
  font-size: 15px;
  min-width: 70px;
  border-radius: 0;
}
.auth-tabs button[aria-pressed="true"] {
  border-bottom: 3px solid var(--green);
  color: var(--green);
}
.muted {
  font-size: 12px;
  color: #72818d;
}
.form-message {
  min-height: 21px;
  color: #a25b3e;
  font-size: 13px;
  margin-bottom: 0;
}
summary {
  padding: 12px 0;
  font-size: 14px;
  cursor: pointer;
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.admin-shell {
  max-width: 1000px;
  margin: 35px auto;
  padding: 0 20px;
}
.admin-list {
  overflow: auto;
  padding: 15px;
  margin: 15px 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 14px;
}
th,
td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}
td button {
  font-size: 13px;
  padding: 7px;
}
@media (min-width: 761px) and (max-width: 1050px) {
  .control-strip {
    grid-template-columns: minmax(260px, 1fr) auto;
  }
  .touch-toolbar {
    grid-column: 1/-1;
    justify-content: flex-end;
  }
  .workspace {
    grid-template-columns: minmax(max-content, 1fr) 260px;
  }
  .zoom-caption {
    display: none;
  }
  .dashboard > div {
    min-width: 100px;
    gap: 7px;
  }
  .levels button {
    padding: 0 8px;
  }
  .guide-card {
    display: none;
  }
}
@media (min-width: 761px) and (max-height: 740px) {
  .guide-card {
    display: none;
  }
  .header {
    min-height: 62px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .shell {
    gap: 9px;
  }
  .control-strip {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .game-card {
    padding: 10px;
    gap: 8px;
  }
  .status {
    min-height: 32px;
    padding: 5px 10px;
  }
}
@media (max-width: 760px) {
  .shell {
    width: calc(100% - 20px);
    min-height: 100dvh;
    margin: 10px auto;
    display: flex;
    flex-direction: column;
    gap: 11px;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .header {
    min-height: 64px;
    padding: 8px 11px;
    gap: 6px;
  }
  .brand {
    font-size: 23px;
    gap: 8px;
  }
  .brand-symbol {
    font-size: 34px;
  }
  .brand small {
    font-size: 11px;
  }
  .header-actions {
    gap: 3px;
  }
  .account {
    font-size: 12px;
    padding: 7px 9px;
    max-width: 135px;
  }
  .header-actions .quiet {
    font-size: 12px;
    padding: 7px 9px;
  }
  .restart {
    height: 40px;
    min-height: 40px;
    width: 40px;
    font-size: 26px;
  }
  .control-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    padding: 10px;
  }
  .levels {
    width: 100%;
    grid-template-columns: repeat(4, 1fr);
  }
  .levels button {
    min-height: 38px;
    font-size: 14px;
    padding: 0 8px;
  }
  .dashboard {
    flex: 1;
    justify-content: space-between;
    gap: 8px;
  }
  .dashboard > div {
    flex: 1;
    min-width: 0;
    height: 42px;
    gap: 7px;
    padding: 0 9px;
  }
  .stat-label {
    font-size: 12px;
  }
  .dashboard strong {
    font-size: 18px;
  }
  .touch-toolbar {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }
  .input-modes button {
    min-height: 40px;
    padding: 6px 23px;
    font-size: 14px;
  }
  .zoom-label {
    font-size: 12px;
  }
  .zoom-label select {
    min-height: 44px;
    font-size: 12px;
  }
  .workspace {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
  }
  .game-card {
    min-width: 0;
    max-width: 100%;
    padding: 10px;
    gap: 10px;
  }
  .status {
    font-size: 12px;
    padding: 8px;
    min-height: 36px;
  }
  .board-scroll {
    min-width: 0;
    overflow: auto;
    max-height: 60dvh;
    display: block;
    padding: 3px;
    flex: none;
    overscroll-behavior: contain;
    touch-action: pan-x pan-y pinch-zoom;
    scrollbar-width: thin;
    scrollbar-color: #778995 #bec8d0;
  }
  .board,
  .cell {
    touch-action: pan-x pan-y pinch-zoom;
  }
  .board {
    border-radius: 4px;
  }
  .cell {
    border-radius: 4px;
  }
  .board-caption {
    font-size: 10px;
    gap: 6px;
  }
  .sidebar {
    width: 100%;
    gap: 10px;
  }
  .side-card {
    padding: 14px 16px;
  }
  .rank-list {
    max-height: 240px;
  }
  .rank-list .empty {
    min-height: 70px;
  }
  .guide-card {
    display: none;
  }
  .rank-note {
    font-size: 11px;
  }
  .personal-card {
    padding: 1px 7px;
  }
  .result {
    bottom: 45px;
    padding: 13px;
    gap: 12px;
  }
  .result strong {
    font-size: 16px;
  }
  .result p {
    font-size: 11px;
  }
  .result .primary {
    padding: 9px 12px;
    font-size: 13px;
  }
  footer {
    flex-wrap: wrap;
    font-size: 10px;
    padding: 5px;
    gap: 5px;
  }
  .leaderboard {
    min-height: 150px;
  }
}
@media (max-width: 360px) {
  .account {
    max-width: 112px;
    font-size: 11px;
    padding: 7px;
  }
  .header-actions .quiet {
    padding: 6px;
  }
  .brand {
    font-size: 21px;
    gap: 6px;
  }
  .brand-symbol {
    font-size: 30px;
  }
  .restart {
    width: 34px;
  }
  .input-modes button {
    padding: 7px 18px;
  }
  .zoom-caption {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
body {
  display: flow-root;
}
