@charset "UTF-8";

:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #244d45;
  background: #f6f5ee;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; background-image: radial-gradient(#bbc6b938 .7px, transparent .7px); background-size: 7px 7px; }
button, a, [role="button"] { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; }
button:disabled { cursor: default; opacity: .35; }
button:focus-visible, a:focus-visible { outline: 3px solid #bc6c36; outline-offset: 4px; }
button svg { width: 19px; height: 19px; flex-shrink: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
.site-shell { width: min(460px, calc(100% - 32px)); margin: 32px auto; }
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; padding: 0 3px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 23px; font-weight: 850; letter-spacing: -.6px; }
.brand > svg { width: 40px; height: 40px; }
.brand-subtitle { display: block; font-weight: 500; font-size: 10px; letter-spacing: 3.8px; margin-top: 1px; }
.game-card { background: #fdfcf7; border: 1px solid #d8ded1; border-radius: 20px; padding: 23px; box-shadow: 0 6px 0 -1px #e7e9df, 0 7px 0 #d7ddcf, 0 18px 45px -30px #325c4540; outline: none; }
.game-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.game-heading h1 { font-size: 24px; letter-spacing: 2px; font-weight: 700; }
.help-button { background: transparent; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; color: #819176; }
.help-button:hover { background: #edf0e4; }
.board-wrapper { background: #edf0e5; border: 1px solid #d4dccd; border-radius: 14px; padding: 0 4px 4px; }
.board-toolbar { padding: 13px 13px 1px; display: flex; align-items: center; justify-content: space-between; color: #70846b; font-size: 12px; }
.move-counter { display: inline-flex; align-items: baseline; gap: 6px; font-size: 12px; color: #8e9c80; }
.move-counter strong { font-family: ui-monospace, monospace; font-size: 20px; color: #375a48; font-weight: 500; }
.maze-board { width: 100%; height: auto; display: block; }
.board-paper { fill: #f8f7ee; stroke: #dfe2d3; stroke-width: 1; }
.grid-pins { fill: #9ea98f; }
.slot { cursor: pointer; outline: none; }
.slot-hit { fill: transparent; }
.empty-track { fill: none; stroke: #9eae94; stroke-width: 2; stroke-dasharray: 4 6; stroke-linecap: round; opacity: .7; }
.match-shadow { fill: #40533d; opacity: .15; }
.match-halo { fill: #3f8d7140; opacity: 0; stroke: #40775f; stroke-width: 1.5; }
.match-wood { fill: #d6ad75; stroke: #b69362; stroke-width: .7; }
.match-grain { stroke: #f8e5b7; stroke-width: 1.3; stroke-linecap: round; opacity: .7; }
.match-head { fill: #765443; stroke: #654a39; stroke-width: .7; }
.slot.selected .match-halo, .slot:focus-visible .match-halo { opacity: 1; }
.slot.selected .match-wood { fill: #efc586; }
.slot:focus-visible .slot-hit { stroke: #326e59; stroke-width: 2; stroke-dasharray: 3 3; }
.slot.compatible .empty-track { stroke: #38765d; stroke-width: 3; opacity: 1; }
@media (hover: hover) {
  .slot.empty:hover .empty-track { stroke: #37765c; opacity: 1; }
  .slot.occupied:hover .match-halo { opacity: .7; }
}
.start-position { fill: none; stroke: #dddbc2; stroke-width: 1; stroke-dasharray: 2 4; }
.player { pointer-events: none; }
.player-aura { fill: #eee5bd; opacity: .6; }
.player-ball { fill: #e9ba5d; stroke: #bd9548; stroke-width: 1.2; }
.player-eye { fill: #745432; }
.player-smile { stroke: #745432; stroke-width: 1.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.player.arrived .player-aura { fill: #bed6a6; opacity: .9; }
.door-shadow { fill: #e3e8d9; }
.exit-door { fill: #3e7966; stroke: #2b6656; stroke-width: 1; }
.game-message { min-height: 46px; padding: 13px 0 10px; color: #819177; font-size: 12px; line-height: 1.8; text-align: center; }
.game-message.warning { color: #a3663b; }
.game-message.success { color: #337649; font-size: 15px; font-weight: 650; }
.play-controls { display: flex; justify-content: center; align-items: center; gap: 35px; padding-top: 3px; }
.direction-pad { display: grid; grid-template-columns: repeat(3, 49px); grid-template-rows: repeat(3, 44px); gap: 5px; }
.direction-button { display: flex; align-items: center; justify-content: center; color: #fcfaf0; background: #2e6253; border: 1px solid #255744; border-radius: 10px; box-shadow: 0 2px 0 #d0d9c8; }
.direction-button:hover:not(:disabled) { background: #214e40; }
.direction-button:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.direction-button svg { width: 23px; height: 23px; }
.direction-up { grid-row: 1; grid-column: 2; }
.direction-left { grid-row: 2; grid-column: 1; }
.direction-right { grid-row: 2; grid-column: 3; }
.direction-down { grid-row: 3; grid-column: 2; }
.direction-left svg { transform: rotate(-90deg); }
.direction-right svg { transform: rotate(90deg); }
.direction-down svg { transform: rotate(180deg); }
.pad-center { grid-row: 2; grid-column: 2; display: grid; place-items: center; color: #adb49a; }
.pad-ball { width: 10px; height: 10px; border-radius: 50%; background: #dfb05b; }
.game-actions { display: grid; gap: 12px; }
.button { min-height: 43px; border-radius: 9px; padding: 12px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; font-weight: 500; }
.button.secondary { background: #f1f2e7; border: 1px solid #dce2d1; color: #6b7f61; }
.button.primary { background: #285c4f; color: #faf9ee; }
.button:hover:not(:disabled) { filter: brightness(.96); }
.rules-dialog { width: min(360px, calc(100% - 40px)); border: 1px solid #d4ddc9; border-radius: 16px; background: #fbfaf2; padding: 23px; color: #315547; box-shadow: 0 20px 90px #19382833; }
.rules-dialog::backdrop { background: #203e3870; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.dialog-heading h2 { font-size: 20px; }
.rules-dialog p { font-size: 13px; line-height: 1.9; color: #70816b; margin-bottom: 13px; }
.rules-dialog > .button { width: 100%; margin-top: 9px; }
.error-page { max-width: 420px; padding: 50px 24px; margin: 0 auto; }
.error-page h1 { font-size: 25px; margin-bottom: 24px; }
@media (max-width: 480px) {
  .site-shell { width: calc(100% - 24px); margin: 16px auto 25px; }
  .game-card { padding: 18px 13px 20px; border-radius: 17px; }
  .game-heading { margin-bottom: 12px; }
  .game-heading h1 { font-size: 22px; }
  .board-toolbar { padding: 12px 12px 0; }
  .play-controls { gap: 25px; }
}
@media (max-width: 350px) {
  .play-controls { gap: 17px; }
  .direction-pad { grid-template-columns: repeat(3, 44px); }
  .button { padding: 12px 10px; font-size: 11px; }
}

.maze-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.maze-links a { padding: 9px 10px; border-radius: 8px; font-size: 12px; line-height: 1.45; white-space: nowrap; }
.maze-links a[aria-current="page"] { background: #e5eee2; font-weight: 650; }
.maze-links a:hover { background: #e9eee2; }
.fractal-wrapper { overflow: hidden; }
.fractal-wrapper .board-toolbar { justify-content: flex-end; }
.fractal-paper { fill: #f8f7ee; }
.fractal-walls { fill: none; stroke: #3a6c72; stroke-width: .06; stroke-linecap: round; }
.fractal-seams { fill: none; stroke: #3a6c72; stroke-width: .045; stroke-dasharray: .2 .17; opacity: .62; }
.fractal-frame { fill: none; stroke: #ad4e34; stroke-width: .105; pointer-events: none; }
.fractal-key { fill: #e9ba5d; stroke: #85611c; stroke-width: .068; stroke-linecap: round; stroke-linejoin: round; }
.fractal-key path { fill: none; }
.fractal-door { fill: #ad4e34; }
.fractal-door.open { fill: #3e7966; }
.fractal-player-halo { fill: #f1c1a7; }
.fractal-player-ball { fill: #b54c33; stroke: #863422; stroke-width: .035; }
.fractal-board .start-position { stroke-width: .047; stroke-dasharray: .09 .11; }
.construction-wrapper { background: #fff9e9; border-color: #e3c173; }
.construction-symbols { position: absolute; }
.construction-budget { display: flex; justify-content: space-evenly; padding: 8px 5px 3px; color: #6d827d; }
.construction-budget svg { width: 34px; height: 26px; }
.construction-budget .spent { opacity: .22; }
.construction-frame, .construction-block { fill: #086a9d; }
.construction-paper { fill: #fff9e9; }
.construction-exit { fill: #d9a23f; }
[data-construction-player] { color: #264d5d; }
.dozer-window { fill: #e3bb62; }
.dozer-wheel { fill: #fff9e9; }
.snake-wrapper { background: #fff7f4; border-color: #e9a4a0; }
.snake-wrapper .board-toolbar { justify-content: flex-end; }
.snake-board { width: min(100%, 258px); margin-inline: auto; }
.snake-paper { fill: #fff9f4; stroke: #efa798; stroke-width: .17; }
.snake-walls { fill: #e46e99; stroke: #e46e99; stroke-width: .035; }
.snake-food { fill: #efa48e; }
.snake-door { fill: #e39d86; }
.snake-door.open { fill: #418063; }
.snake-door.open .snake-lock { display: none; }
.snake-lock { fill: #5e3b3c; }
.snake-body { fill: none; stroke: #ad5662; stroke-width: .5; stroke-linecap: round; stroke-linejoin: round; }
.snake-head { fill: #8f3b4d; }
.gravity-wrapper { background: #edf7f5; border-color: #9acfc0; padding: 5px; }
.gravity-board { width: min(100%, 350px); margin-inline: auto; }
.gravity-rim { fill: #50c9a8; }
.gravity-frame { fill: #70aee8; stroke: #fffdf3; stroke-width: .24; }
.gravity-paper { fill: #fffdf3; }
.gravity-walls { fill: #70aee8; stroke: #70aee8; stroke-width: .045; }
.gravity-arrow { fill: none; stroke: #188f70; stroke-width: .1; stroke-linecap: round; stroke-linejoin: round; }
.gravity-door { fill: #248568; }
.gravity-ball { fill: #26c5a0; stroke: #186a55; stroke-width: .065; }
.gravity-walk { display: flex; gap: 8px; }
.gravity-walk .direction-button { width: 54px; height: 48px; }
@media (max-width: 350px) {
  .maze-links a { padding-inline: 7px; font-size: 11px; }
}

.jump-wrapper { background: #edf6f3; border-color: #a8cfc4; padding: 4px; }
.jump-board { width: min(100%, 350px); margin-inline: auto; }
.jump-rim { fill: #7183c4; }
.jump-paper { fill: #fffdf5; }
.jump-field { fill: #79bdad; }
.jump-tile { fill: #fffdf5; }
.jump-arrow { fill: none; stroke: #315787; stroke-width: .09; stroke-linecap: round; stroke-linejoin: round; }
.jump-door, .jump-ball { fill: #4a5ea1; }

.connect-four {
  --c4-red: #bf4530;
  --c4-blue: #2266af;
  --c4-ink: #213958;
  color: var(--c4-ink);
}
.connect-four .game-heading { align-items: flex-start; }
.connect-four .help-button { width: 44px; height: 44px; color: #536982; margin: -5px -5px 0 0; }
.connect-four-subtitle { margin-top: 5px; font-size: 12px; color: #546981; }
.connect-four-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 10px;
  padding: 4px;
  background: #e8eef5;
  border-radius: 11px;
}
.connect-four-modes button {
  min-height: 44px;
  border-radius: 8px;
  background: transparent;
  font-size: 14px;
  font-weight: 650;
}
.connect-four-modes button[aria-pressed="true"] { background: #254467; color: #fff; }
.connect-four-modes button:disabled { opacity: 1; }
.connect-four-order:not([hidden]) { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.connect-four-order button {
  min-height: 44px;
  border: 1px solid #ced9e8;
  border-radius: 8px;
  background: #f7f9fc;
  font-size: 13px;
}
.connect-four-order button[aria-pressed="true"] { background: #e3edf9; border-color: #6387b0; font-weight: 650; }
.connect-four-order button:disabled { opacity: 1; }
.connect-four-hud { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.connect-four-turn, .connect-four-gravity {
  min-height: 59px;
  display: flex;
  padding: 8px 10px;
  align-items: center;
  border: 1px solid #d7e3ed;
  border-radius: 10px;
  background: #eff4f9;
  font-size: 14px;
}
.connect-four-turn { gap: 7px; }
.connect-four-turn i { width: 16px; height: 16px; flex: 0 0 auto; border-radius: 50%; background: #687b94; }
.connect-four-turn[data-player="red"] { background: #fff0e8; border-color: #f0d1c4; color: #8e3426; }
.connect-four-turn[data-player="blue"] { background: #e9f2ff; border-color: #d0e1f6; color: #234e88; }
.connect-four-turn[data-player="red"] i { background: var(--c4-red); }
.connect-four-turn[data-player="blue"] i { background: var(--c4-blue); }
.connect-four-gravity { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; }
.connect-four-gravity span { color: #4e617a; font-size: 11px; }
.connect-four-stage {
  --rail: 20px;
  --rim: 8px;
  padding: calc(var(--rail) + var(--rim));
  background: #e8eef5;
  border: 1px solid #d3dde9;
  border-radius: 14px;
}
.connect-four-board {
  position: relative;
  aspect-ratio: 7 / 6;
  border-radius: 4px;
  background: #264164;
  box-shadow: 0 0 0 var(--rim) #264164, 0 3px 0 calc(var(--rim) + 1px) #152e4d;
}
.connect-four-slots, .connect-four-pieces, .connect-four-input { position: absolute; inset: 0; }
.connect-four-slots {
  display: grid;
  pointer-events: none;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(0, 1fr));
}
.connect-four-slots i {
  margin: 10%;
  border: 1px solid #10253e;
  border-radius: 50%;
  background: #192f4c;
  box-shadow: inset 0 2px 3px #0a1e35;
}
.connect-four-pieces { overflow: hidden; pointer-events: none; }
.connect-four-token { position: absolute; top: 0; left: 0; width: calc(100% / 7); height: calc(100% / 6); }
.connect-four-token::before, .connect-four-token::after { content: ''; position: absolute; border-radius: 50%; }
.connect-four-token::before { inset: 10%; border: 1px solid; box-shadow: inset 0 -3px 0 #0003; }
.connect-four-token[data-player="red"]::before { background: #f07c5c; border-color: #9b372b; }
.connect-four-token[data-player="blue"]::before { background: #70b1f6; border-color: #255995; }
.connect-four-token::after { inset: 26%; }
.connect-four-token[data-player="red"]::after { background: #df6146; }
.connect-four-token[data-player="blue"]::after { background: transparent; border: 2px solid #295b9e; }
.connect-four-token.winning::before { box-shadow: inset 0 0 0 2px #fff3aa, 0 0 6px #fff3aa; }
.connect-four-input {
  z-index: 1;
  display: grid;
  grid-template: minmax(0, 1fr) / repeat(7, minmax(0, 1fr));
}
.connect-four-input button {
  position: relative;
  display: block;
  appearance: none;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border-radius: 5px;
  background: transparent;
}
.connect-four-input button[aria-disabled="true"] { cursor: default; }
.connect-four-input button span {
  position: absolute;
  pointer-events: none;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  background: #d9e5f2;
  color: #254467;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  font: 650 11px ui-monospace, monospace;
}
.connect-four-input button.full span { color: #627388; background: transparent; }
.connect-four-input button:focus-visible { outline: 2px solid #fff3ad; outline-offset: -2px; }
.connect-four-input button:active[aria-disabled="false"] { background: #d5eaff36; }
@media (hover: hover) {
  .connect-four-input button:hover[aria-disabled="false"] { background: #d5eaff24; }
}
.connect-four-stage[data-gravity="down"] .connect-four-input { top: calc(-1 * (var(--rail) + var(--rim))); }
.connect-four-stage[data-gravity="up"] .connect-four-input { bottom: calc(-1 * (var(--rail) + var(--rim))); }
.connect-four-stage[data-gravity="down"] .connect-four-input button span { top: 2px; }
.connect-four-stage[data-gravity="up"] .connect-four-input button span { bottom: 2px; }
.connect-four-hint { min-height: 38px; display: grid; place-items: center; color: #4d647f; font-size: 13px; }
.connect-four-settings { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 7px; align-items: center; }
.connect-four-settings label { color: #4d647f; font-size: 12px; white-space: nowrap; }
.connect-four-settings select {
  width: 100%;
  min-height: 44px;
  padding: 5px;
  border: 1px solid #ced9e8;
  border-radius: 8px;
  background: #f7f9fc;
  color: inherit;
  font: 500 16px system-ui, sans-serif;
}
.connect-four-settings select:focus-visible { outline: 2px solid #2266af; outline-offset: 2px; }
.connect-four-settings .button {
  min-height: 44px;
  padding-inline: 9px;
  border-color: #ced9e8;
  background: #edf2f8;
  color: var(--c4-ink);
  white-space: nowrap;
}
.connect-four-settings svg { width: 15px; height: 15px; }
@media (max-width: 380px) {
  .connect-four-stage { --rail: 16px; --rim: 7px; }
  .connect-four-input button span { width: 15px; }
  .connect-four-settings .button svg { display: none; }
}
