/* Buildiful® shell and Stepcells — neutral gray edition. Coral and teal communicate clue types only. */
:root {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #292f36; background: #f3f4f5; font-size: 16px; line-height: 1.48;
  font-synthesis: none;
  --navy: #30343a; --ink: #292f36; --muted: #666e77;
  --coral: #f4776e; --teal: #80c7c6; --stroke: #dfe2e5;
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body { min-height: 100vh; margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 3px solid #b6a15a; outline-offset: 3px; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: 3px; }
.page { min-height: 100vh; display: flex; flex-direction: column; }
.header { background: var(--navy); color: white; }
.header-inner, .footer-inner { width: min(1120px, 100%); margin: auto; display: flex; align-items: center; gap: 18px; padding: 17px clamp(16px, 4vw, 36px); }
.brand { flex: 0 0 auto; text-decoration: none; }
.brand img { display: block; height: 37px; width: auto; max-width: 100%; }
.divider { width: 2px; height: 31px; background: #ffffff66; }
.tool-name { text-decoration: none; font-size: 27px; font-weight: 750; letter-spacing: .015em; }
.tool-name:hover, .footer a:hover { text-decoration: underline; }
.main { flex: 1; width: min(740px, 100%); margin: 0 auto; padding: clamp(24px, 5vw, 55px) 15px 52px; }
.game-card { background: #fff; border: 1px solid var(--stroke); border-radius: 18px; padding: clamp(18px, 4vw, 35px); box-shadow: 0 8px 32px #15181b09; }
.game-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.top-controls { display: flex; align-items: center; gap: 10px; }
.round-tag { color: #42474d; font-size: 13px; letter-spacing: .13em; font-weight: 750; }
.icon-button, .sound-switch { border: 1px solid #d9dce0; background: #fafafb; color: #484f56; border-radius: 9px; height: 40px; }
.icon-button:hover, .sound-switch:hover { background: #ededee; }
.icon-button { width: 40px; font-weight: 750; font-size: 19px; font-family: Georgia, serif; }
.icon-button span { border: 1.7px solid currentColor; border-radius: 50%; display: grid; place-items: center; margin: auto; width: 21px; height: 21px; font-style: normal; font-size: 14px; line-height: 1; }
.sound-switch { padding: 0 11px; font-size: 13px; font-weight: 650; display: flex; align-items: center; gap: 7px; }
#soundIcon { font-size: 20px; line-height: 1; }
.sound-switch[aria-pressed="false"] #soundIcon { opacity: .45; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 29px 0 26px; }
.stat { text-align: center; border: 1px solid #e9ebed; background: #f8f9fa; border-radius: 11px; padding: 10px 5px 8px; }
.stat-label { display: block; font-size: 11px; color: #666d73; letter-spacing: .09em; font-weight: 800; }
.stat-number { display: block; font-size: 28px; color: #30363c; line-height: 1.3; font-variant-numeric: tabular-nums; }
.puzzle-area { border-top: 1px solid #ebedef; border-bottom: 1px solid #ebedef; text-align: center; padding: 26px 0; }
.cells { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: clamp(4px, 1vw, 8px); width: 100%; max-width: 575px; margin: 0 auto; }
.cell { appearance: none; display: grid; place-items: center; aspect-ratio: .92; min-width: 0; width: 100%; border: 2px solid #dce0e4; border-radius: 9px; background: #f1f2f4; color: #30363b; font-weight: 850; font-size: clamp(16px, 3.3vw, 25px); padding: 0; box-shadow: 0 3px 0 #e0e2e5; transition: background-color .12s, transform .12s; }
.cell:not(:disabled):hover { transform: translateY(-1px); }
.cell.is-active { outline: 3px solid #747b82; outline-offset: 2px; border-color: #8c949a; }
.cell.is-solved { background: #e0e5e8; border-color: #c6ced4; box-shadow: 0 3px 0 #ccd3d7; color: #222b31; }
.cell.is-teal { background: var(--teal); border-color: #61aaa9; box-shadow: 0 3px 0 #62aaa9; color: #1f4142; }
.cell.is-coral { background: var(--coral); border-color: #df625b; box-shadow: 0 3px 0 #db6660; color: #fff; }
.cell.is-peek { background: #626a73; border-color: #545c64; box-shadow: 0 3px 0 #4b535a; color: #fff; }
.keyboard-wrap { padding-top: 26px; }
.keyboard { display: flex; flex-direction: column; gap: 8px; }
.keyboard-row { display: flex; gap: 6px; justify-content: center; }
.key { flex: 1 1 0; min-width: 0; max-width: 55px; height: 49px; background: #f1f2f4; border: 1px solid #dce0e4; border-bottom: 3px solid #cbd0d5; border-radius: 8px; color: #373d43; font-size: 17px; font-weight: 800; padding: 0; touch-action: manipulation; }
.key:hover { background: #e6e8ea; }
.key:active { background: #d9dde0; transform: translateY(1px); }
.keyboard-tools { margin-top: 4px; }
.keyboard-extra { background: transparent; color: #535960; border: 1px solid #d7dce0; border-radius: 8px; min-height: 37px; padding: 5px 14px; font-size: 13px; }
.keyboard-extra:hover { background: #f3f4f5; }
.game-actions { display: flex; justify-content: center; margin-top: 24px; }
.secondary-button, .primary-button { border-radius: 9px; border: 1px solid #c8cdd1; min-height: 44px; font-weight: 750; font-size: 14px; padding: 10px 21px; }
.secondary-button { background: #fff; color: #40464c; }
.secondary-button:hover { background: #f4f5f6; }
.secondary-button.another, .primary-button { background: #343a40; color: #fff; border-color: #343a40; }
.secondary-button.another:hover, .primary-button:hover { background: #515961; }
.win-card { margin-top: 24px; border: 1px solid #d6e3df; background: #f2f8f6; border-radius: 12px; padding: 17px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 9px; }
.win-card h2 { color: #2c4c46; margin: 0; font-size: 23px; }
.win-card p { margin: 0; color: #526a64; font-size: 14px; }
.win-card .primary-button { margin-top: 5px; }
.win-card .copy-feedback { min-height: 16px; color: #2b6259; }
.footer { border-top: 1px solid #dfe2e4; background: white; color: #454c52; font-size: 15px; }
.footer-inner { justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.footer-links { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-links span { color: #747c82; }
.help-dialog { width: min(480px, calc(100% - 28px)); max-height: min(720px, calc(100dvh - 32px)); overflow-y: auto; border: 1px solid #d9dde0; border-radius: 16px; padding: 22px 25px 24px; color: #343a40; box-shadow: 0 18px 55px #0003; }
.help-dialog::backdrop { background: #2024288f; }
.help-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.help-header h2 { font-size: 23px; margin: 0; }
.close-info { border: none; background: #f1f2f3; border-radius: 7px; font-size: 28px; color: #4e555a; width: 38px; height: 38px; line-height: 1; }
.close-info:hover { background: #e3e5e7; }
.help-dialog > p { margin: 0 0 13px; color: #5d666d; font-size: 14px; }
.clue-item { display: grid; grid-template-columns: 56px 1fr; gap: 14px; border-top: 1px solid #e5e8ea; padding: 14px 0; align-items: center; }
.sample-cell { width: 52px; height: 55px; display: grid; place-items: center; border-radius: 7px; font-size: 20px; font-weight: 800; border: 1px solid #0001; }
.sample-solved { background: #e0e5e8; color: #28333a; }
.sample-teal { background: var(--teal); color: #1f4142; }
.sample-coral { background: var(--coral); color: white; }
.clue-item h3 { margin: 0 0 4px; font-size: 16px; }
.clue-item p { margin: 0; color: #586169; font-size: 13px; line-height: 1.45; }
.help-dialog > p.help-tip { border-top: 1px solid #e5e8ea; padding-top: 15px; margin: 0; font-size: 12px; }
.privacy-main { width: min(850px, 100%); padding-top: 40px; padding-bottom: 65px; }
.privacy-main h1 { font-size: clamp(36px, 6vw, 52px); margin: 14px 0 25px; }
.privacy-main h2 { font-size: 25px; margin: 34px 0 12px; }
.privacy-main p { font-size: 16px; line-height: 1.65; margin: 0 0 18px; }
#analyticsManageWrap { margin: 22px 0; }
#analyticsManageWrap[hidden] { display: none !important; }
#analyticsManage { min-height: 44px; background: var(--navy); color: white; border: 1px solid var(--navy); border-radius: 9px; padding: 10px 18px; }
@media (max-width: 560px) {
  .header-inner { gap: 12px; padding: 13px 16px; }
  .brand img { height: 29px; }
  .divider { height: 24px; }
  .tool-name { font-size: 22px; }
  .main { padding: 20px 10px 32px; }
  .game-card { padding: 19px 13px 22px; border-radius: 14px; }
  .stats { margin: 22px 0; gap: 6px; }
  .stat-label { font-size: 10px; letter-spacing: .04em; }
  .stat-number { font-size: 25px; }
  .puzzle-area { padding: 24px 0; }
  .cells { gap: 4px; }
  .cell { border-radius: 7px; font-size: clamp(16px, 5.1vw, 23px); }
  .keyboard-wrap { padding-top: 22px; }
  .keyboard-row { gap: 4px; }
  .key { height: 44px; font-size: 14px; border-radius: 6px; }
  .footer-inner { align-items: flex-start; }
  .privacy-main { padding: 26px 19px 50px; }
}
@media (max-width: 345px) {
  .brand img { height: 25px; }
  .tool-name { font-size: 20px; }
  .sound-switch { font-size: 12px; padding: 0 8px; }
  .game-card { padding: 17px 9px; }
  .key { height: 41px; }
  .help-dialog { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
