:root {
  --bg: #0b1d2a;
  --panel: #0f2433;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  background: radial-gradient(circle at 50% 18%, #15324a 0%, var(--bg) 70%);
  color: #eaf2f8;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

#game {
  display: block;
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
  touch-action: none;
  cursor: pointer;
}

.menu-button,
.icon-button,
.tab {
  font: inherit;
  color: inherit;
}

.menu-button {
  position: fixed;
  z-index: 4;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(5, 18, 30, 0.74);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.menu-dialog {
  width: min(440px, calc(100vw - 28px));
  border: 0;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  color: #f6fbff;
  margin: auto;
}

.menu-dialog::backdrop {
  background: rgba(2, 8, 14, 0.64);
  backdrop-filter: blur(4px);
}

.menu-panel {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(13, 50, 76, 0.98), rgba(5, 20, 34, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
}

.menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 12px;
}

.menu-head strong {
  font-size: 18px;
  letter-spacing: 0;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0 18px 14px;
}

.tab {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  font-weight: 800;
}

.tab.is-active {
  border-color: rgba(255, 211, 63, 0.7);
  background: #ffd23f;
  color: #06121d;
}

.tab-panel {
  display: none;
  padding: 2px 20px 22px;
}

.tab-panel.is-active {
  display: block;
}

.tab-panel h2 {
  margin-bottom: 8px;
  font-size: 22px;
  letter-spacing: 0;
}

.tab-panel p {
  color: rgba(246, 251, 255, 0.84);
  font-size: 15px;
  line-height: 1.55;
}

#hint {
  font-size: 14px;
  letter-spacing: 0.3px;
  opacity: 0.65;
  text-align: center;
}

/* Mobile: edge-to-edge full screen, no frame, no hint. */
body.mobile {
  background: #000;
}

body.mobile #app {
  gap: 0;
}

body.mobile #game {
  border-radius: 0;
  box-shadow: none;
}

body.mobile #hint {
  display: none;
}
