.foak-room {
  display: grid;
  align-items: start;
  gap: 20px;
}

.foak-room-main {
  display: grid;
  min-width: 0;
  gap: 20px;
}

.foak-settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.foak-settings-form .base-game-button {
  grid-column: 1 / -1;
}

.foak-settings-form label {
  display: grid;
  gap: 7px;
  color: #cbd5e1;
  font-weight: 700;
}

.foak-settings-form select,
.foak-settings-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 8px;
  background: #0f172a;
  color: #f8fafc;
}

.foak-end-condition {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
}

.foak-end-condition legend {
  padding: 0 6px;
  color: #cbd5e1;
  font-weight: 700;
}

.foak-settings-form .foak-end-condition-option {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.42);
}

.foak-settings-form .foak-end-condition-option input[type="radio"] {
  width: auto;
  margin: 0;
  padding: 0;
  accent-color: #fbbf24;
}

.foak-end-condition-option select {
  min-width: 0;
  flex: 1 1 auto;
}

.foak-end-condition-option select:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.foak-players {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.foak-player-card {
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.5);
}

.foak-player-card strong {
  color: #f8fafc;
}

.foak-player-card > span {
  display: block;
  margin-top: 8px;
  color: #cbd5e1;
}

.foak-player-state-resigned {
  color: #fca5a5 !important;
  font-weight: 900;
}

.foak-game-area {
  position: relative;
  min-height: 300px;
  display: grid;
  container-type: inline-size;
  place-items: center;
  gap: 24px;
  padding: 24px;
  color: #fff7ed;
  background:
    linear-gradient(rgba(74, 42, 20, 0.2), rgba(45, 25, 13, 0.45)),
    repeating-linear-gradient(90deg, #754d2d 0, #7f5735 45px, #704728 90px);
  box-shadow: inset 0 0 32px rgba(30, 15, 7, 0.45);
}
.foak-game-area[hidden] {
  display: none;
}

.foak-card {
  box-sizing: border-box;
  width: 256px;
  height: 160px;
  aspect-ratio: 8 / 5;
  border: 1px solid #111827;
  border-radius: 22px;
  background: #fff;
  transition: border-color 100ms ease, box-shadow 100ms ease;
}

.foak-card-slots {
  --foak-card-width: min(256px, 40cqw);
  --foak-circle-radius: clamp(120px, calc(50cqw - 116px), 230px);
  --foak-arrow-shaft-length: clamp(30px, calc(var(--foak-circle-radius) - 144px), 88px);
  position: relative;
  width: 100%;
  min-height: 620px;
  z-index: 1;
}

.foak-scoreboard,
.foak-elapsed-clock,
.foak-interval-controls,
.foak-claim-controls,
.foak-claim-options-panel,
.foak-helper-output {
  z-index: 2;
  padding: 12px;
  border: 1px solid rgba(251, 191, 36, 0.34);
  border-radius: 12px;
  background: rgba(43, 27, 15, 0.78);
  box-shadow: 0 8px 20px rgba(30, 15, 7, 0.28);
}

.foak-scoreboard {
  position: absolute;
  top: 50%;
  left: 24px;
  width: min(190px, 20%);
  transform: translateY(-50%);
}

.foak-interval-controls {
  position: absolute;
  bottom: 24px;
  left: 24px;
  width: min(190px, 20%);
}

.foak-elapsed-clock {
  position: absolute;
  top: 24px;
  left: 50%;
  width: min(440px, 46%);
  transform: translateX(-50%);
  text-align: center;
}

.foak-scoreboard h3,
.foak-interval-controls h3,
.foak-helper-output h3 {
  margin: 0 0 10px;
  color: #fde68a;
  font-size: 1rem;
}

.foak-current-interval {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 8px 10px;
  border: 1px solid rgba(251, 191, 36, 0.34);
  border-radius: 8px;
  color: #fff7ed;
  background: rgba(15, 23, 42, 0.58);
  font: inherit;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  isolation: isolate;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease, transform 120ms ease;
}

.foak-card-interval-progress {
  position: absolute;
  z-index: 0;
  inset: 0 auto 0 0;
  width: calc(var(--foak-card-interval-progress, 0) * 100%);
  background: rgba(251, 191, 36, 0.34);
  pointer-events: none;
}

#foak-current-interval-value {
  position: relative;
  z-index: 1;
}

.foak-current-interval.is-selected .foak-card-interval-progress {
  background: rgba(120, 53, 15, 0.35);
}

.foak-current-interval:hover:not(:disabled) {
  border-color: #fbbf24;
  background: rgba(146, 64, 14, 0.58);
  transform: translateY(-1px);
}

.foak-current-interval:focus-visible {
  outline: 2px solid #fff7ed;
  outline-offset: 2px;
}

.foak-current-interval.is-selected {
  border-color: #fde68a;
  color: #422006;
  background: #fbbf24;
  box-shadow: inset 0 0 0 1px rgba(66, 32, 6, 0.28);
}

.foak-current-interval:disabled:not(.is-selected) {
  opacity: 0.58;
}

.foak-current-interval:disabled {
  cursor: default;
}

.foak-game-progress-metrics {
  display: grid;
  grid-template-columns: minmax(64px, 0.8fr) minmax(110px, 1.35fr) minmax(76px, 0.9fr);
  align-items: center;
}

.foak-game-progress-metric {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 0 10px;
}

.foak-game-progress-metric + .foak-game-progress-metric {
  border-left: 1px solid rgba(251, 191, 36, 0.34);
}

.foak-game-progress-metric > span {
  color: #fde68a;
  font-size: 0.78rem;
  font-weight: 700;
}

.foak-game-progress-metric output {
  color: #fff7ed;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.foak-interval-votes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.foak-interval-votes label {
  display: block;
  min-width: 0;
  cursor: pointer;
}

.foak-interval-votes input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.foak-interval-votes span {
  display: flex;
  min-height: 38px;
  padding: 7px 8px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(251, 191, 36, 0.42);
  border-radius: 8px;
  color: #ffedd5;
  background: rgba(15, 23, 42, 0.48);
  font-size: 0.85rem;
  font-weight: 700;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease, transform 120ms ease;
}

.foak-interval-votes svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.foak-interval-votes label:hover input:not(:disabled) + span {
  border-color: #fbbf24;
  color: #fff7ed;
  background: rgba(146, 64, 14, 0.58);
  transform: translateY(-1px);
}

.foak-interval-votes input:focus-visible + span {
  outline: 2px solid #fff7ed;
  outline-offset: 2px;
}

.foak-interval-votes input:checked + span {
  border-color: #fde68a;
  color: #422006;
  background: #fbbf24;
  box-shadow: inset 0 0 0 1px rgba(66, 32, 6, 0.28);
}

.foak-interval-votes input:disabled:not(:checked) + span {
  opacity: 0.58;
}

.foak-interval-votes input:disabled + span {
  cursor: default;
}

.foak-scoreboard-players {
  display: grid;
  gap: 7px;
}

.foak-scoreboard-player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  will-change: transform;
}

.foak-scoreboard-identity {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.foak-scoreboard-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.foak-scoreboard-ban {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  color: #fca5a5;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
}

.foak-scoreboard-ban svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.foak-scoreboard-ban circle {
  fill: #dc2626;
}

.foak-scoreboard-ban path {
  fill: none;
  stroke: #fff;
  stroke-width: 2.3;
  stroke-linecap: round;
}

.foak-scoreboard-score {
  position: relative;
  display: block;
  min-width: 2ch;
  height: 1.2em;
  overflow: hidden;
  color: #fff7ed;
  line-height: 1.2;
  text-align: right;
}

.foak-scoreboard-score-number {
  position: absolute;
  inset: 0;
  display: block;
  text-align: right;
}

.foak-scoreboard-values {
  display: grid;
  justify-items: end;
  flex: 0 0 auto;
}

.foak-claim-column {
  position: absolute;
  top: 24px;
  right: 24px;
  width: min(360px, calc(100% - 48px));
  z-index: 2;
  display: grid;
  gap: 10px;
}

.foak-claim-controls {
  text-align: center;
}

.foak-claim-button {
  width: 100%;
  font-size: 1.05rem;
}

.foak-final-results-button {
  box-sizing: border-box;
  position: absolute;
  z-index: 3;
  top: 24px;
  left: 24px;
  display: inline-grid;
  width: 60px;
  height: 60px;
  place-items: center;
  padding: 0;
  border: 2px solid rgba(254, 243, 199, 0.86);
  border-radius: 15px;
  color: #422006;
  background: #fef3c7;
  box-shadow: 0 4px 9px rgba(0, 0, 0, 0.32);
  font: inherit;
  cursor: pointer;
  animation: foak-final-results-glow 1.45s ease-in-out infinite;
}

.foak-final-results-button:hover:not(:disabled),
.foak-final-results-button:focus-visible {
  border-color: #fbbf24;
  background: #fde68a;
}

.foak-final-results-button[hidden] {
  display: none;
}

.foak-final-results-button:disabled {
  opacity: 0.58;
  cursor: wait;
  animation: none;
}

.foak-final-results-button img {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
}

@keyframes foak-final-results-glow {
  0%,
  100% {
    box-shadow: 0 4px 9px rgba(0, 0, 0, 0.32), 0 0 0 rgba(251, 191, 36, 0);
    transform: translateY(0) scale(1);
  }

  50% {
    box-shadow: 0 4px 9px rgba(0, 0, 0, 0.32), 0 0 22px rgba(251, 191, 36, 0.72);
    transform: translateY(-1px) scale(1.04);
  }
}

.foak-claim-status {
  margin: 8px 0 0;
  color: #ffedd5;
  font-size: 0.82rem;
  line-height: 1.35;
}

.foak-claim-countdown {
  height: 10px;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid rgba(253, 230, 138, 0.72);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
}

.foak-claim-countdown[hidden] {
  display: none;
}

.foak-claim-countdown span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: hsl(120 75% 42%);
  transform: scaleX(1);
  transform-origin: left center;
  transition: transform 100ms linear, background-color 100ms linear;
}

.foak-helper-output {
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: min(220px, 24%);
}

#foak-helper-values {
  display: grid;
  gap: 4px;
  color: #fff7ed;
  font-size: 0.88rem;
}

.foak-claim-options-panel[hidden] {
  display: none;
}

.foak-claim-options-panel h3 {
  margin: 0 0 10px;
  color: #fde68a;
  font-size: 0.95rem;
}

.foak-claim-keyboard-hint {
  margin: -4px 0 10px;
  color: #fed7aa;
  font-size: 0.78rem;
  line-height: 1.35;
}

.foak-claim-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.foak-claim-options .base-game-button {
  min-width: 0;
  min-height: 58px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
}

.foak-claim-options .base-game-button.is-keyboard-selected {
  border-color: #fde68a;
  color: #fff7ed;
  background: #92400e;
  outline: 3px solid #fff7ed;
  outline-offset: 2px;
}

.foak-claim-option-visual {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
}

.foak-claim-color-swatch,
.foak-claim-shading {
  box-sizing: border-box;
  border: 2px solid #111;
  border-radius: 4px;
}

.foak-claim-shading {
  border-color: #fbbf24;
}

.foak-claim-color-red {
  background: #c70f0f;
}

.foak-claim-color-blue {
  background: #0826bd;
}

.foak-claim-color-green {
  background: #009900;
}

.foak-claim-shape {
  fill: #fbbf24;
}

.foak-claim-shading-solid {
  background: #fbbf24;
}

.foak-claim-shading-striped {
  background: repeating-linear-gradient(135deg, #fbbf24 0 4px, #fff 4px 8px);
}

.foak-claim-shading-open {
  background: #fff;
}

.foak-card-slot {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: var(--foak-card-width);
  justify-items: center;
  transform:
    translate(-50%, -50%)
    rotate(var(--foak-slot-angle))
    translateY(calc(-1 * var(--foak-circle-radius) * var(--foak-slot-distance-multiplier, 1)))
    rotate(calc(-1 * var(--foak-slot-angle)));
}

.foak-next-slot-arrow {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 0;
  height: 0;
  pointer-events: none;
  transform: rotate(var(--foak-slot-angle));
  animation: foak-next-slot-arrow-rotate 250ms cubic-bezier(0.22, 0.8, 0.33, 1) both;
  will-change: transform;
}

@keyframes foak-next-slot-arrow-rotate {
  from {
    transform: rotate(var(--foak-arrow-from-angle));
  }

  to {
    transform: rotate(var(--foak-slot-angle));
  }
}

.foak-next-slot-arrow::before {
  position: absolute;
  bottom: 0;
  left: -3px;
  width: 6px;
  height: var(--foak-arrow-shaft-length);
  content: '';
  border-radius: 999px;
  background: #fbbf24;
  box-shadow: 0 0 0 2px #111827, 0 2px 6px rgba(17, 24, 39, 0.8);
}

.foak-next-slot-arrow::after {
  position: absolute;
  bottom: var(--foak-arrow-shaft-length);
  left: -12px;
  width: 0;
  height: 0;
  content: '';
  border-right: 12px solid transparent;
  border-bottom: 18px solid #fbbf24;
  border-left: 12px solid transparent;
  filter: drop-shadow(0 1px 1px #111827);
}

.foak-card-slot-active .foak-card {
  outline: 8px solid #000;
  outline-offset: 2px;
  box-shadow: none;
}

.foak-empty-card {
  background: #f8fafc;
}

.foak-playing-card {
  overflow: hidden;
}

.foak-claim-mask-card {
  display: grid;
  place-items: center;
  color: #6b7280;
  font-size: clamp(4rem, 14cqw, 7rem);
  font-weight: 700;
  line-height: 1;
}

.foak-empty-set-card {
  display: grid;
  place-items: center;
  color: rgba(0, 0, 0, 0.2);
  font-size: clamp(4rem, 14cqw, 7rem);
  font-weight: 700;
  line-height: 1;
}

.foak-card-svg {
  display: block;
  width: 100%;
  height: 100%;
}
.foak-sidebar-toggle {
  width: 38px;
  min-width: 38px;
  padding: 7px;
}

.foak-sidebar-toggle-icon {
  display: grid;
  width: 18px;
  gap: 4px;
}

.foak-sidebar-toggle-icon span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.base-game-navbar-room #settings-summary {
  flex: 0 0 auto;
  justify-content: flex-start;
}

.base-game-navbar-room > .foak-sidebar-toggle {
  margin-left: auto;
}

.base-game-room-info-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-inline: 12px;
}

.base-game-room-settings-dialog {
  width: min(520px, calc(100vw - 32px));
}

.base-game-room-settings-dialog-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.foak-final-results-dialog {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px;
  border: 2px solid #fbbf24;
  border-radius: 16px;
  color: #fff7ed;
  background: #422006;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.62);
}

.foak-final-results-dialog::backdrop {
  background: rgba(30, 15, 7, 0.75);
  backdrop-filter: blur(3px);
}

.foak-final-results-dialog h3 {
  margin: 0 0 16px;
}

.foak-final-results-table-wrap {
  overflow-x: auto;
}

.foak-final-results-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid rgba(254, 215, 170, 0.35);
  border-radius: 12px;
  background: rgba(67, 20, 7, 0.45);
}

.foak-final-results-table th,
.foak-final-results-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(254, 215, 170, 0.22);
  text-align: center;
}

.foak-final-results-table th {
  color: #fef3c7;
  background: rgba(120, 53, 15, 0.65);
}

.foak-final-results-table tr:last-child td {
  border-bottom: 0;
}

.foak-final-reaction-results {
  margin-top: 24px;
}

.foak-final-reaction-results h4,
.foak-final-reaction-results > p {
  margin: 0;
}

.foak-final-reaction-results > p {
  margin-top: 6px;
  color: #fed7aa;
}

.foak-final-results-histograms {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}

.foak-reaction-histogram {
  min-width: 0;
  overflow-x: auto;
  padding: 14px;
  border: 1px solid rgba(254, 215, 170, 0.3);
  border-radius: 12px;
  background: rgba(67, 20, 7, 0.45);
}

.foak-reaction-histogram h5,
.foak-reaction-histogram-empty {
  margin: 0;
}

.foak-reaction-histogram-empty {
  margin-top: 8px;
  color: #fed7aa;
}

.foak-reaction-histogram-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 8px;
  color: #fef3c7;
  font-size: 0.85rem;
}

.foak-reaction-histogram-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.foak-reaction-histogram-legend span::before {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  content: "";
}

.foak-reaction-histogram-legend .is-correct::before {
  background: rgba(34, 197, 94, 0.68);
}

.foak-reaction-histogram-legend .is-unsuccessful::before {
  background: rgba(239, 68, 68, 0.68);
}

.foak-reaction-histogram svg {
  display: block;
  width: 100%;
  min-width: 420px;
  margin-top: 8px;
}

.foak-reaction-axis {
  stroke: #fed7aa;
  stroke-width: 1.5;
}

.foak-reaction-bar {
  opacity: 0.62;
}

.foak-reaction-bar-correct {
  fill: #22c55e;
}

.foak-reaction-bar-unsuccessful {
  fill: #ef4444;
}

.foak-reaction-axis-label,
.foak-reaction-axis-title {
  fill: #fef3c7;
  font-family: inherit;
  font-size: 12px;
}

.foak-reaction-axis-title {
  font-weight: 700;
}

.foak-final-numeric-value {
  font-variant-numeric: tabular-nums;
}

.foak-final-elo-change {
  font-weight: 900;
}

.foak-final-elo-change.positive {
  color: #22c55e;
}

.foak-final-elo-change.negative,
.foak-resigned-text {
  color: #ef4444;
}

.foak-final-results-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.foak-room-sidebar {
  display: grid;
  grid-template-rows: auto minmax(120px, 1fr) minmax(240px, 2fr);
  min-width: 0;
  overflow: hidden;
}

.foak-room-info {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 92px;
  padding: 12px;
  border-bottom: 1px solid rgba(251, 191, 36, 0.3);
  color: #fff7ed;
  background: #1a2844;
}

.foak-room-info h3,
.foak-room-info p {
  margin: 0;
}

.foak-room-info p {
  color: #fde68a;
  line-height: 1.45;
}

body.foak-game-active .foak-room {
  display: flex;
  width: 100%;
  align-items: start;
  overflow-x: clip;
}

body.foak-game-active .foak-room-main {
  width: 0;
  flex: 1 1 auto;
  min-width: 0;
  gap: 0;
}

body.foak-game-active .foak-players {
  display: none;
}

body.foak-game-active .foak-game-area {
  min-height: calc(100vh - 60px);
}

body.foak-game-active .foak-card-slots {
  min-height: 680px;
}

body.foak-game-active .foak-card-slot .foak-card {
  width: 100%;
  height: auto;
}

body.foak-game-active .foak-room-sidebar {
  position: sticky;
  top: 60px;
  width: 290px;
  height: calc(100vh - 60px);
  flex: 0 0 290px;
  opacity: 1;
  transform: translateX(0);
  transition: width 260ms ease, flex-basis 260ms ease, opacity 180ms ease, transform 260ms ease, visibility 0s linear;
  visibility: visible;
}

body.foak-game-active .base-game-room-chat {
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

body.foak-game-active .base-game-room-chat .base-game-chat-messages {
  min-height: 0;
  max-height: none;
}

body.foak-game-active.foak-sidebar-collapsed .foak-room-sidebar {
  width: 0;
  flex-basis: 0;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.foak-status {
  min-height: 1.6rem;
  margin-top: 18px;
  color: #cbd5e1;
}

.foak-status.error {
  color: #fca5a5;
}

.base-game-lobby-chat {
  grid-column: 1 / -1;
}

@media (max-width: 1000px) {
  .foak-room,
  body.foak-game-active .foak-room {
    display: grid;
    grid-template-columns: 1fr;
  }

  body.foak-game-active .foak-room-main {
    width: 100%;
  }

  body.foak-game-active .foak-room-sidebar {
    position: static;
    width: 100%;
    height: auto;
    max-height: 900px;
    flex-basis: auto;
    transition: max-height 300ms ease, opacity 180ms ease, transform 300ms ease, visibility 0s linear;
  }

  body.foak-game-active.foak-sidebar-collapsed .foak-room-sidebar {
    width: 100%;
    flex-basis: auto;
    max-height: 0;
    transform: translateY(-16px);
  }

  .foak-room-sidebar {
    grid-template-rows: auto auto;
  }

  .base-game-private-notes textarea {
    min-height: 120px;
    resize: vertical;
  }

  body.foak-game-active .base-game-room-chat .base-game-chat-messages {
    min-height: 112px;
    max-height: 240px;
  }
}

@media (max-width: 760px) {
  .foak-settings-form {
    grid-template-columns: 1fr;
  }

  .foak-end-condition {
    grid-template-columns: 1fr;
  }

  .foak-game-area,
  body.foak-game-active .foak-game-area {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "score claim"
      "clock clock"
      "interval helper"
      "board board";
    align-items: start;
    gap: 14px;
    padding: 16px;
  }

  .foak-scoreboard,
  .foak-elapsed-clock,
  .foak-interval-controls,
  .foak-claim-column,
  .foak-helper-output {
    position: static;
    width: auto;
    transform: none;
  }

  .foak-scoreboard {
    grid-area: score;
  }

  .foak-elapsed-clock {
    grid-area: clock;
  }

  .foak-interval-controls {
    grid-area: interval;
  }

  .foak-claim-column {
    grid-area: claim;
  }

  .foak-card-slots,
  body.foak-game-active .foak-card-slots {
    grid-area: board;
    min-height: 560px;
  }

  .foak-helper-output {
    grid-area: helper;
  }

  .foak-claim-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .foak-claim-options .base-game-button {
    min-height: 64px;
    padding: 5px 2px;
    flex-direction: column;
    gap: 3px;
    font-size: 0.72rem;
  }
}

@media (min-width: 761px) and (min-height: 600px) and (max-width: 1366px) and (orientation: landscape) and (any-pointer: coarse) {
  body.foak-game-active .foak-room {
    display: block;
  }

  body.foak-game-active .foak-room-main {
    width: 100%;
  }

  body.foak-game-active .foak-room-sidebar {
    position: fixed;
    z-index: 12000;
    top: 60px;
    right: 0;
    width: min(320px, 88vw);
    height: calc(100vh - 60px);
    max-height: none;
    overflow-y: auto;
    transform: translateX(0);
  }

  body.foak-game-active.foak-sidebar-collapsed .foak-room-sidebar {
    width: min(320px, 88vw);
    max-height: none;
    transform: translateX(100%);
  }

  .foak-room-sidebar {
    grid-template-rows: minmax(150px, 1fr) minmax(260px, 2fr);
  }

  .base-game-private-notes textarea {
    min-height: 80px;
    resize: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.foak-game-active .foak-room-sidebar,
  .foak-card,
  .foak-next-slot-arrow {
    transition: none;
  }

  .foak-next-slot-arrow {
    animation: none;
  }

  .foak-final-results-button {
    animation: none;
  }
}
