/*
 * Responsive polish
 * Scrollbars stay available to keyboard/touch users, but their visual chrome
 * is hidden so the table remains the focus of the interface.
 */
html,
body {
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.app-shell::-webkit-scrollbar,
.modal::-webkit-scrollbar,
.sheet::-webkit-scrollbar,
.mode-picker::-webkit-scrollbar,
.mode-picker-card::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

html,
body,
.app-shell,
.modal,
.sheet,
.mode-picker,
.mode-picker-card {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.app-shell {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

/* Keep overlays inside the viewport while allowing their content to scroll. */
.modal-backdrop,
.side-sheet,
.mode-picker {
  overflow: hidden;
  overscroll-behavior: contain;
}

.modal {
  max-width: min(540px, 100%);
  max-height: min(calc(100dvh - 32px), 760px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sheet {
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mode-picker-card {
  max-height: calc(100dvh - 30px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.match-layout,
.game-view,
.topbar,
.topbar-left,
.topbar-actions,
.player-panel,
.settings-row,
.modal-footer {
  min-width: 0;
}

.player-ident,
.settings-row > div {
  min-width: 0;
}

.player-name,
.player-type,
.settings-row p,
.settings-row small {
  overflow-wrap: anywhere;
}

.player-panel.right {
  position: relative;
}

.player-comment {
  position: relative;
  width: min(230px, 100%);
  margin-top: 18px;
  align-self: flex-end;
  padding: 11px 13px 12px;
  border: 1px solid hsl(var(--border));
  border-radius: 12px 12px 3px 12px;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  box-shadow: 0 8px 20px rgba(36, 51, 42, .1);
  font-size: .74rem;
  line-height: 1.45;
  text-align: left;
  animation: comment-pop .28s cubic-bezier(.22, 1, .36, 1) both;
}

.player-comment::after {
  content: '';
  position: absolute;
  right: 0;
  margin-top: 7px;
  border-top: 7px solid hsl(var(--card));
  border-left: 7px solid transparent;
}

.player-comment-label {
  display: block;
  margin-bottom: 4px;
  color: hsl(var(--accent));
  font: .58rem var(--app-font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.player-comment-text {
  display: block;
}

.player-comment.is-typing .player-comment-text {
  min-height: 1.45em;
  color: hsl(var(--muted-foreground));
}

.player-comment.is-typing .player-comment-text::after {
  content: '•••';
  display: inline-block;
  margin-left: 2px;
  color: hsl(var(--accent));
  letter-spacing: .13em;
  animation: comment-dots 1s steps(3, end) infinite;
}

.modal-footer {
  flex-wrap: wrap;
}

@keyframes comment-pop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes comment-dots {
  0% {
    opacity: .25;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: .25;
  }
}

@media (max-width: 1050px) and (min-width: 821px) {
  .game-view {
    padding-right: clamp(14px, 2.5vw, 28px);
    padding-left: clamp(14px, 2.5vw, 28px);
  }

  .match-layout {
    grid-template-columns: minmax(130px, 1fr) minmax(380px, 58vw) minmax(130px, 1fr);
    gap: clamp(12px, 2vw, 24px);
  }

  .player-panel {
    min-height: 360px;
  }
}

@media (max-width: 820px) {
  .game-view {
    width: 100%;
  }

  .match-layout {
    width: 100%;
  }

  .board-zone {
    min-width: 0;
  }

  .board-frame {
    width: 100%;
  }

  .player-panel,
  .player-panel.right {
    width: 100%;
    min-width: 0;
  }

  .score-block {
    min-width: 0;
  }

  .score {
    line-height: .9;
  }

  .modal-backdrop,
  .mode-picker {
    padding: 12px;
  }

  .modal,
  .mode-picker-card {
    width: 100%;
    max-height: calc(100dvh - 24px);
  }

  .settings-row {
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .game-view {
    padding-right: 10px;
    padding-left: 10px;
  }

  .topbar {
    gap: 10px;
  }

  .topbar-left {
    gap: 10px;
  }

  .topbar-actions {
    flex: 0 0 auto;
  }

  .player-panel,
  .player-panel.right {
    gap: 10px;
  }

  .player-ident {
    gap: 8px;
  }

  .player-name {
    font-size: .98rem;
  }

  .player-type {
    font-size: .64rem;
  }

  .score {
    font-size: 2.65rem;
  }

  .turn-pill {
    padding: 7px 9px;
    font-size: .65rem;
  }

  .player-panel.right {
    margin-bottom: 74px;
  }

  .player-panel.right .player-comment {
    position: absolute;
    top: calc(100% + 2px);
    right: 4px;
    width: min(250px, 70vw);
    margin-top: 0;
  }

  .modal {
    padding: 22px 18px 18px;
  }

  .modal-heading {
    margin-bottom: 22px;
  }

  .modal h2 {
    font-size: clamp(1.7rem, 9vw, 2.25rem);
  }

  .settings-row {
    gap: 10px;
    padding: 13px 0;
  }

  .settings-row p {
    font-size: .82rem;
  }

  .settings-row small {
    font-size: .68rem;
    line-height: 1.35;
  }

  .modal-footer {
    gap: 8px;
    margin-top: 24px;
    padding-top: 16px;
  }

  .modal-footer .button-primary,
  .modal-footer .button-quiet {
    flex: 1 1 150px;
    min-width: 0;
    padding-right: 14px;
    padding-left: 14px;
  }

  .mode-picker-card {
    padding: 22px 16px 18px;
  }
}

@media (max-width: 360px) {
  .game-view {
    padding-right: 8px;
    padding-left: 8px;
  }

  .icon-button {
    width: 33px;
    height: 33px;
  }

  .player-token {
    width: 31px;
    height: 31px;
  }

  .score {
    font-size: 2.35rem;
  }

  .score-caption {
    letter-spacing: .1em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .player-comment {
    animation: none;
  }
}

/*
 * Mobile game layout
 *
 * The bundled layout has three desktop columns. On a phone that leaves the
 * player panels competing for the same narrow row, especially after the WOF
 * profile card is inserted into each panel. Use a real stacked layout below
 * tablet width and keep each player's metadata in a compact, predictable row.
 */
@media (max-width: 820px) {
  .game-view {
    box-sizing: border-box;
    width: 100%;
    padding-right: clamp(10px, 4vw, 24px);
    padding-left: clamp(10px, 4vw, 24px);
  }

  .match-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(12px, 3vw, 18px);
    width: 100%;
  }

  .board-zone {
    grid-row: 1;
    min-width: 0;
  }

  .board-frame {
    box-sizing: border-box;
    width: 100%;
  }

  .player-panel,
  .player-panel.right {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-rows: auto auto;
    grid-template-areas:
      "rank rank rank"
      "ident score turn";
    align-items: center;
    width: 100%;
    min-width: 0;
    min-height: 0;
    gap: clamp(7px, 2vw, 12px);
    padding: clamp(11px, 3vw, 15px);
    border: 1px solid hsl(var(--border));
    border-radius: 14px;
    background: hsl(var(--card) / .48);
    text-align: left;
  }

  .player-panel:first-child {
    grid-row: 2;
  }

  .player-panel:last-child {
    grid-row: 3;
  }

  .player-ident,
  .player-panel.right .player-ident {
    grid-area: ident;
    min-width: 0;
    justify-self: start;
    flex-direction: row;
    gap: clamp(7px, 2vw, 10px);
    text-align: left;
  }

  .player-panel.right .player-ident {
    flex-direction: row-reverse;
    justify-self: end;
    text-align: right;
  }

  .player-ident > div {
    min-width: 0;
  }

  .player-name,
  .player-type {
    max-width: 11ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
  }

  .player-name {
    font-size: clamp(.92rem, 3.9vw, 1.08rem);
  }

  .player-type {
    font-size: clamp(.58rem, 2.5vw, .7rem);
  }

  .player-token {
    flex: 0 0 auto;
    width: clamp(30px, 8vw, 38px);
    height: clamp(30px, 8vw, 38px);
  }

  .score-block {
    grid-area: score;
    align-items: baseline;
    min-width: 0;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 5px;
  }

  .score {
    font-size: clamp(2rem, 9vw, 3rem);
    line-height: .9;
  }

  .score-caption {
    max-width: 7ch;
    margin: 0;
    font-size: clamp(.48rem, 1.9vw, .6rem);
    line-height: 1.1;
    letter-spacing: .06em;
  }

  .turn-pill,
  .right .turn-pill {
    grid-area: turn;
    align-self: center;
    min-width: max-content;
    padding: 7px 9px;
    font-size: clamp(.56rem, 2.2vw, .68rem);
  }

  /*
   * Rank cards are injected as the first child of a player panel. Give them
   * their own row instead of allowing them to steal width from the score row.
   */
  .player-panel .wof-profile-rank {
    grid-area: rank;
    width: 100%;
    min-width: 0;
    margin: 0;
    align-self: auto;
  }

  .player-panel .wof-profile-rank .wof-rank-card {
    box-sizing: border-box;
    width: 100%;
  }

  .game-controls {
    flex-wrap: wrap;
    gap: 4px;
    margin-top: clamp(12px, 3vw, 20px);
  }

  .control-button {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .topbar {
    gap: 8px;
    margin-bottom: 16px;
  }

  .topbar-left {
    min-width: 0;
    gap: 8px;
  }

  .mini-brand {
    min-width: 0;
    font-size: .61rem;
  }

  .mini-brand .mini-mark {
    flex: 0 0 auto;
  }

  .topbar-actions {
    gap: 4px;
  }

  .icon-button {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
  }

  .player-panel,
  .player-panel.right {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
    padding: 10px;
  }

  .player-name {
    max-width: 9ch;
  }

  .player-type {
    max-width: 9ch;
  }

  .score {
    font-size: clamp(1.85rem, 9vw, 2.55rem);
  }

  .score-caption {
    max-width: 6ch;
    letter-spacing: .035em;
  }

  .turn-pill,
  .right .turn-pill {
    gap: 5px;
    padding: 7px 8px;
  }

  .start-content {
    width: 100%;
  }

  .start-content > section {
    min-width: 0;
  }

  .start-title {
    font-size: clamp(3.35rem, 17vw, 5rem);
  }

  .start-copy {
    max-width: 34rem;
    font-size: .92rem;
  }

  .start-actions > button {
    flex: 1 1 180px;
  }

  .start-content .oc-wallet {
    position: static;
    justify-self: center;
    width: min(100%, 220px);
    min-width: 0;
    margin-top: 18px;
  }

  .start-board-wrap {
    width: 100%;
  }
}

@media (max-width: 360px) {
  .game-view {
    padding-right: 8px;
    padding-left: 8px;
  }

  .player-panel,
  .player-panel.right {
    gap: 5px;
    padding: 8px;
  }

  .player-name,
  .player-type {
    max-width: 8ch;
  }

  .player-type {
    font-size: .55rem;
  }

  .score {
    font-size: 1.85rem;
  }

  .score-caption {
    display: none;
  }

  .turn-pill,
  .right .turn-pill {
    padding-right: 7px;
    padding-left: 7px;
    font-size: .54rem;
  }
}

/*
 * Phone match view
 *
 * Keep the actual match on one screen. The board gets the full width, while
 * the two opponents share the row beneath it like a compact chess clock bar.
 */
@media (max-width: 520px) {
  body:has(.game-view) {
    overflow: hidden;
  }

  .app-shell:has(.game-view) {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .game-view {
    box-sizing: border-box;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-right: 8px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    padding-left: 8px;
  }

  .topbar {
    margin-bottom: 9px;
  }

  .match-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto;
    align-items: start;
    gap: 9px;
  }

  .board-zone {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .player-panel,
  .player-panel.right {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "rank rank"
      "ident ident"
      "score turn";
    align-items: center;
    align-self: start;
    gap: 6px;
    min-height: 0;
    padding: 9px;
    border-radius: 12px;
  }

  .player-panel:first-child,
  .player-panel:last-child {
    grid-row: 2;
  }

  .player-panel:first-child {
    grid-column: 1;
  }

  .player-panel:last-child {
    grid-column: 2;
  }

  .player-ident,
  .player-panel.right .player-ident {
    grid-area: ident;
    justify-self: stretch;
    width: 100%;
    gap: 6px;
  }

  .player-panel.right .player-ident {
    justify-self: stretch;
    flex-direction: row-reverse;
    text-align: right;
  }

  .player-token {
    width: 28px;
    height: 28px;
    padding: 4px;
  }

  .player-name,
  .player-type {
    max-width: 8ch;
  }

  .player-name {
    font-size: .9rem;
  }

  .player-type {
    font-size: .54rem;
  }

  .score-block {
    grid-area: score;
    justify-self: start;
    gap: 3px;
  }

  .score {
    font-size: 2rem;
  }

  .score-caption {
    max-width: 5ch;
    font-size: .46rem;
    letter-spacing: .02em;
  }

  .turn-pill,
  .right .turn-pill {
    grid-area: turn;
    justify-self: end;
    gap: 4px;
    padding: 6px 7px;
    font-size: .5rem;
  }

  .player-panel .wof-profile-rank {
    grid-area: rank;
  }

  .player-panel .wof-profile-rank .wof-rank-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px;
    min-height: 38px;
    padding: 7px;
  }

  .player-panel .wof-profile-rank .wof-rank-emblem {
    width: 24px;
    height: 24px;
  }

  .player-panel .wof-profile-rank .wof-rank-title {
    font-size: .75rem;
  }

  .player-panel .wof-profile-rank .wof-rank-kicker {
    font-size: .45rem;
  }

  .game-controls {
    gap: 2px;
    margin-top: 8px;
  }

  .control-button {
    min-height: 34px;
    padding: 6px 5px;
    gap: 4px;
    font-size: .62rem;
  }

  .status-line {
    min-height: 16px;
    margin-top: 6px;
    font-size: .62rem;
  }
}

@media (max-width: 360px) {
  .match-layout {
    gap: 7px;
  }

  .player-panel,
  .player-panel.right {
    gap: 5px;
    padding: 7px;
  }

  .player-token {
    width: 25px;
    height: 25px;
    padding: 3px;
  }

  .player-name {
    font-size: .82rem;
  }

  .player-type {
    font-size: .5rem;
  }

  .score {
    font-size: 1.75rem;
  }

  .turn-pill,
  .right .turn-pill {
    padding-right: 5px;
    padding-left: 5px;
    font-size: .46rem;
  }
}

/*
 * Put each turn clock in the marked, center-facing position. The clock is
 * created inside .score-block by turn-clock.js, so display: contents lets the
 * clock become a direct grid item without changing the game logic.
 */
@media (max-width: 520px) {
  .player-panel,
  .player-panel.right {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "rank rank"
      "ident clock"
      "score turn";
  }

  .player-panel.right {
    grid-template-areas:
      "rank rank"
      "clock ident"
      "score turn";
  }

  .player-panel .score-block {
    display: contents;
  }

  .player-panel .score {
    grid-area: score;
    align-self: end;
  }

  .player-panel .score-caption {
    display: none;
  }

  .player-panel .player-turn-clock {
    grid-area: clock;
    justify-self: end;
    min-width: 56px;
    margin: 0;
    padding: 6px 6px 5px;
    font-size: .68rem;
    letter-spacing: .035em;
  }

  .player-panel.right .player-turn-clock {
    justify-self: start;
  }

  .player-panel .player-turn-clock::before {
    margin-right: 4px;
    font-size: .4rem;
  }
}

@media (max-width: 360px) {
  .player-panel .player-turn-clock {
    min-width: 52px;
    padding-right: 5px;
    padding-left: 5px;
    font-size: .61rem;
  }

  .player-panel .player-turn-clock::before {
    margin-right: 3px;
    font-size: .36rem;
  }
}

/*
 * Phone start screen
 *
 * The wallet is appended after the preview board by oc-rewards.js. Keeping it
 * in normal flow creates a third block below the fold, so turn it into a
 * compact header action and use the remaining viewport for the preview.
 */
@media (max-width: 520px) {
  body:has(.start-view) {
    overflow: hidden;
  }

  .app-shell:has(.start-view) {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .start-view {
    box-sizing: border-box;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-right: 12px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    padding-left: 12px;
  }

  .start-content {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    gap: 0;
    width: 100%;
    height: 100%;
  }

  .start-content > section:first-child {
    flex: 0 0 auto;
    min-width: 0;
    text-align: center;
  }

  .brand-lockup {
    justify-content: center;
    gap: 9px;
    margin-bottom: 14px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    box-shadow: inset 0 0 0 4px #f3efe233;
  }

  .brand-mark:after {
    width: 10px;
    height: 10px;
  }

  .brand-name {
    font-size: .63rem;
  }

  .start-title {
    font-size: clamp(2.95rem, 13vw, 4.1rem);
    line-height: .86;
  }

  .start-copy {
    max-width: 31rem;
    margin: 13px auto 15px;
    font-size: .78rem;
    line-height: 1.42;
  }

  .start-actions {
    gap: 8px;
  }

  .start-actions > button {
    flex: 1 1 135px;
    min-height: 40px;
    padding-right: 12px;
    padding-left: 12px;
    font-size: .75rem;
  }

  /* This utility row is rendered without a class in the bundled app. */
  .start-content > section:first-child > div:last-child {
    justify-content: center;
    gap: 5px !important;
    margin-top: 12px !important;
    font-size: .62rem !important;
  }

  .start-content > section:first-child > div:last-child .control-button {
    min-height: 28px;
    padding: 4px 5px;
    font-size: .6rem;
  }

  .start-board-wrap {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    margin-top: 8px;
  }

  .start-board {
    box-sizing: border-box;
    flex: 0 1 auto;
    width: min(76vw, 250px, calc(100dvh - 300px));
    max-width: 100%;
    max-height: calc(100dvh - 300px);
    padding: 8px;
  }

  .start-badge {
    right: max(-10px, -3vw);
    bottom: 7%;
    padding: 8px 10px;
    font-size: .61rem;
  }

  .start-badge strong {
    font-size: 1.03rem;
  }

  /*
   * Keep the wallet available without allowing it to add height below the
   * preview. Its title and aria-label still expose the balance to users.
   */
  .start-content .oc-wallet {
    position: absolute;
    top: max(8px, env(safe-area-inset-top));
    right: 0;
    width: 34px;
    min-width: 34px;
    height: 34px;
    box-sizing: border-box;
    justify-content: center;
    gap: 0;
    margin: 0;
    padding: 1px;
  }

  .start-content .oc-wallet-icon {
    width: 29px;
    height: 29px;
  }

  .start-content .oc-wallet-copy {
    display: none;
  }
}

@media (max-width: 360px) {
  .start-view {
    padding-right: 8px;
    padding-left: 8px;
  }

  .start-title {
    font-size: clamp(2.7rem, 13vw, 3.55rem);
  }

  .start-copy {
    margin-top: 10px;
    margin-bottom: 12px;
    font-size: .72rem;
  }

  .start-actions > button {
    min-height: 37px;
    font-size: .68rem;
  }

  .start-content > section:first-child > div:last-child {
    margin-top: 8px !important;
  }

  .start-board {
    width: min(76vw, calc(100dvh - 285px));
    max-height: calc(100dvh - 285px);
    padding: 7px;
  }

  .start-badge {
    right: -7px;
    padding: 6px 8px;
  }

  .start-badge strong {
    font-size: .9rem;
  }
}

/*
 * Give the start screen its visual breathing room back. The previous
 * no-scroll pass protected the viewport by making the preview too small; the
 * board can safely use more of the available width and height now that the
 * wallet no longer occupies a full block below it.
 */
@media (max-width: 520px) {
  .brand-lockup {
    margin-bottom: 17px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-name {
    font-size: .66rem;
  }

  .start-title {
    font-size: clamp(3.25rem, 14.5vw, 4.55rem);
    line-height: .88;
  }

  .start-copy {
    margin-top: 16px;
    margin-bottom: 18px;
    font-size: .82rem;
    line-height: 1.5;
  }

  .start-actions {
    gap: 10px;
  }

  .start-actions > button {
    min-height: 44px;
    padding-right: 14px;
    padding-left: 14px;
    font-size: .78rem;
  }

  .start-content > section:first-child > div:last-child {
    gap: 7px !important;
    margin-top: 16px !important;
  }

  .start-content > section:first-child > div:last-child .control-button {
    min-height: 30px;
    padding: 5px 6px;
    font-size: .62rem;
  }

  .start-board-wrap {
    margin-top: 12px;
  }

  .start-board {
    width: min(90vw, 315px, calc(100dvh - 235px));
    max-height: calc(100dvh - 235px);
    padding: 10px;
  }

  .start-badge {
    bottom: 8%;
    padding: 9px 12px;
    font-size: .65rem;
  }

  .start-badge strong {
    font-size: 1.12rem;
  }
}

@media (max-width: 360px) {
  .start-title {
    font-size: clamp(3rem, 14vw, 4rem);
  }

  .start-copy {
    margin-top: 13px;
    margin-bottom: 15px;
    font-size: .76rem;
  }

  .start-actions > button {
    min-height: 41px;
  }

  .start-content > section:first-child > div:last-child {
    margin-top: 12px !important;
  }

  .start-board {
    width: min(88vw, calc(100dvh - 285px));
    max-height: calc(100dvh - 285px);
    padding: 8px;
  }
}

/*
 * Living preview board
 */
.start-board-grid {
  position: relative;
}

.start-cell.preview-thinking {
  background: #d8c78b38;
  box-shadow: inset 0 0 0 2px #eedeb477;
}

.start-cell.preview-landed {
  animation: preview-cell-land .52s ease-out both;
}

.start-piece.preview-piece {
  animation: preview-piece-place .46s cubic-bezier(.2, .8, .25, 1) both;
}

.start-piece.is-flipping {
  animation: preview-piece-flip .54s ease both;
}

@keyframes preview-cell-land {
  0% {
    background: #eedeb477;
  }
  100% {
    background: transparent;
  }
}

@keyframes preview-piece-place {
  0% {
    opacity: 0;
    transform: scale(.18) translateY(-5px);
  }
  70% {
    opacity: 1;
    transform: scale(1.08) translateY(0);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes preview-piece-flip {
  0% {
    transform: rotateY(0) scale(1);
  }
  48% {
    transform: rotateY(90deg) scale(.84);
  }
  100% {
    transform: rotateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .start-cell.preview-landed,
  .start-piece.preview-piece,
  .start-piece.is-flipping {
    animation: none;
  }
}