:root {
  color-scheme: dark;
}

.eyeball-settings-form #create-room-button {
  grid-column: 1 / -1;
}

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

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

.eyeball-settings-form .eyeball-end-condition-option {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.eyeball-end-condition-option input {
  min-width: 0;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease,
    background-color 120ms ease,
    opacity 120ms ease;
}

.eyeball-end-condition-option:not(.is-selected) input {
  opacity: 0.48;
  cursor: pointer;
}

.eyeball-settings-form .eyeball-end-condition-option.is-selected input {
  opacity: 1;
  border-color: var(--dropdown-selected-border);
  background: var(--dropdown-selected-background);
  box-shadow: 0 0 0 2px var(--dropdown-selected-ring);
}

.eyeball-room {
  max-width: 100%;
}

.eyeball-game {
  --eyeball-canvas-maximum-width: 960px;
  --eyeball-summary-maximum-width: 21rem;
  --eyeball-game-layout-gap: 1rem;
  --eyeball-docked-sidebar-width: 300px;
  --eyeball-room-wide-horizontal-padding: 48px;
  position: relative;
  display: grid;
  width: min(
    100%,
    calc(
      var(--eyeball-canvas-maximum-width) + var(--eyeball-summary-maximum-width) +
        var(--eyeball-game-layout-gap)
    ),
    calc(100vw - var(--eyeball-docked-sidebar-width) - var(--eyeball-room-wide-horizontal-padding))
  );
  min-width: 0;
  margin-inline: auto;
  gap: 0.9rem;
}

.eyeball-game[hidden] {
  display: none;
}

.eyeball-waiting-practice {
  display: grid;
  width: min(100%, 960px);
  margin-inline: auto;
  gap: 0.9rem;
  padding: clamp(0.85rem, 2vw, 1.2rem);
  border: 1px solid rgb(148 163 184 / 24%);
  border-radius: 0.9rem;
  background: rgb(15 23 42 / 64%);
}

.eyeball-waiting-practice[hidden] {
  display: none;
}

.eyeball-waiting-practice-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.eyeball-waiting-practice-heading h2,
.eyeball-waiting-practice-heading p,
.eyeball-waiting-practice-feedback p {
  margin: 0;
}

.eyeball-waiting-practice-heading p {
  margin-top: 0.25rem;
  color: #cbd5e1;
}

#eyeball-practice-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
  border: 1px solid rgb(148 163 184 / 35%);
  border-radius: 0.8rem;
  background:
    linear-gradient(rgb(15 23 42 / 88%), rgb(15 23 42 / 88%)),
    repeating-linear-gradient(0deg, transparent 0 29px, rgb(148 163 184 / 10%) 30px),
    repeating-linear-gradient(90deg, transparent 0 29px, rgb(148 163 184 / 10%) 30px);
  touch-action: manipulation;
}

#eyeball-practice-canvas.is-active {
  cursor: crosshair;
  border-color: #f472b6;
  box-shadow: 0 0 0 2px rgb(244 114 182 / 20%);
}

#eyeball-practice-canvas.is-selecting-cut-part {
  cursor: pointer;
}

#eyeball-practice-canvas.is-expanding-cut-part {
  cursor: progress;
}

.eyeball-waiting-practice-feedback {
  display: grid;
  min-height: 3rem;
  gap: 0.35rem;
  text-align: center;
}

.eyeball-scoreboard h3 {
  margin: 0;
}

.eyeball-game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, var(--eyeball-summary-maximum-width));
  gap: var(--eyeball-game-layout-gap);
  align-items: stretch;
}

.eyeball-board-column {
  display: grid;
  align-self: start;
  min-width: 0;
}

.eyeball-game-summary {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgb(148 163 184 / 24%);
  border-radius: 12px;
  background: #111c33;
}

.eyeball-game-stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.eyeball-game-stat-row--primary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.eyeball-game-stat-row + .eyeball-game-stat-row,
.eyeball-game-action-area {
  border-top: 1px solid rgb(148 163 184 / 20%);
}

.eyeball-game-stat {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
  padding: 13px 8px;
  text-align: center;
}

.eyeball-game-stat + .eyeball-game-stat {
  border-left: 1px solid rgb(148 163 184 / 20%);
}

.eyeball-game-stat span {
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}

.eyeball-game-stat strong {
  min-width: 0;
  color: #f8fafc;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  overflow-wrap: anywhere;
  white-space: nowrap;
}

.eyeball-game-action-area {
  display: grid;
  align-content: center;
  gap: 0.8rem;
  min-width: 0;
  padding: 1rem;
  text-align: center;
}

.eyeball-game-action-area > p {
  margin: 0;
}

#eyeball-canvas {
  display: block;
  width: 100%;
  max-width: min(var(--eyeball-canvas-maximum-width), calc(160vh - 280px));
  max-width: min(var(--eyeball-canvas-maximum-width), calc(160dvh - 280px));
  height: auto;
  aspect-ratio: 8 / 5;
  margin-inline: auto;
  border: 1px solid rgb(148 163 184 / 35%);
  border-radius: 0.8rem;
  background:
    linear-gradient(rgb(15 23 42 / 88%), rgb(15 23 42 / 88%)),
    repeating-linear-gradient(0deg, transparent 0 29px, rgb(148 163 184 / 10%) 30px),
    repeating-linear-gradient(90deg, transparent 0 29px, rgb(148 163 184 / 10%) 30px);
  touch-action: none;
}

#eyeball-canvas.is-active {
  cursor: crosshair;
  border-color: #f472b6;
  box-shadow: 0 0 0 2px rgb(244 114 182 / 20%);
}

#eyeball-canvas.is-expanding-cut-part {
  cursor: progress;
}

.eyeball-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: #f8fafc;
  background: #1a2844;
}

.eyeball-room-info[hidden] {
  display: none;
}

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

.eyeball-room-info p {
  min-height: 1.5rem;
  color: #fde68a;
  line-height: 1.45;
}

.eyeball-status {
  min-height: 1.5rem;
  margin: 0;
}

.eyeball-estimate-panel {
  display: grid;
  gap: 0.7rem;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
}

.eyeball-estimate-panel[hidden] {
  display: none;
}

.eyeball-estimate-panel h3,
.eyeball-estimate-panel p {
  margin: 0;
}

.eyeball-estimate-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.eyeball-estimate-actions[hidden] {
  display: none;
}

.eyeball-estimate-actions .base-game-button {
  transform: none;
}

.eyeball-estimate-actions .eyeball-estimate-button {
  gap: 0.5rem;
  border: 1px solid transparent;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    filter 140ms ease,
    opacity 140ms ease;
}

.eyeball-estimate-actions .eyeball-estimate-button--less {
  border-color: rgb(147 197 253 / 55%);
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.eyeball-estimate-actions .eyeball-estimate-button--more {
  border-color: rgb(253 186 116 / 58%);
  background: linear-gradient(135deg, #ea580c, #c2410c);
}

.eyeball-estimate-icon {
  width: 1.2rem;
  height: 1.2rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.eyeball-estimate-actions .eyeball-estimate-button.is-selected,
.eyeball-estimate-actions .eyeball-estimate-button.is-selected:disabled {
  border-color: #f8fafc;
  opacity: 1;
  filter: none;
  cursor: default;
  box-shadow:
    0 0 0 3px rgb(248 250 252 / 28%),
    0 8px 22px rgb(2 6 23 / 38%);
}

.eyeball-estimate-actions .eyeball-estimate-button.is-dimmed,
.eyeball-estimate-actions .eyeball-estimate-button.is-dimmed:disabled {
  opacity: 0.3;
  filter: saturate(0.35);
  cursor: default;
  box-shadow: none;
}

.eyeball-scoreboard {
  grid-column: 1 / -1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-self: start;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgb(148 163 184 / 24%);
  border-radius: 12px;
  background: #111c33;
}

.eyeball-scoreboard-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 12px;
}

.eyeball-scoreboard-scroll {
  width: 100%;
  overflow-x: auto;
}

.eyeball-scoreboard-scroll:focus-visible {
  outline: 2px solid #fbbf24;
  outline-offset: 3px;
}

.eyeball-scoreboard-table {
  width: 100%;
  min-width: 52rem;
  border-collapse: collapse;
}

.eyeball-scoreboard-table th,
.eyeball-scoreboard-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgb(148 163 184 / 20%);
  vertical-align: middle;
  white-space: nowrap;
}

.eyeball-scoreboard-table thead th {
  color: #94a3b8;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.eyeball-scoreboard-table th:first-child,
.eyeball-scoreboard-table td:first-child {
  width: 3.5rem;
}

.eyeball-scoreboard-table th:nth-child(2),
.eyeball-scoreboard-table td:nth-child(2) {
  min-width: 11rem;
}

.eyeball-score-row:last-child > * {
  border-bottom: 0;
}

.eyeball-score-row.is-you > * {
  background: rgb(251 191 36 / 8%);
}

.eyeball-score-row.is-you > :first-child {
  box-shadow: inset 3px 0 #fbbf24;
}

.eyeball-score-rank,
.eyeball-score-value,
.eyeball-score-last-round,
.eyeball-cutter-count {
  font-variant-numeric: tabular-nums;
}

.eyeball-score-last-round.is-positive,
.eyeball-score-value {
  color: #6ee7b7;
  font-weight: 800;
}

.eyeball-score-last-round.is-zero,
.eyeball-score-last-round.is-empty {
  color: #94a3b8;
}

.eyeball-score-answer {
  color: #fbcfe8;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.eyeball-score-value {
  position: relative;
  display: grid;
  grid-template-areas: 'score';
  height: 1.2em;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.eyeball-score-number {
  grid-area: score;
  display: block;
  text-align: end;
}

.eyeball-score-identity,
.eyeball-score-identity .player-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.eyeball-score-identity {
  max-width: 100%;
}

.eyeball-score-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eyeball-final-results-button {
  box-sizing: border-box;
  display: grid;
  width: 60px;
  height: 60px;
  margin: 0;
  justify-self: center;
  place-items: center;
  padding: 0;
  border: 2px solid rgb(254 243 199 / 86%);
  border-radius: 15px;
  color: #422006;
  background: #fef3c7;
  box-shadow: 0 4px 9px rgb(0 0 0 / 32%);
  font: inherit;
  cursor: pointer;
  animation: eyeball-final-results-glow 1.45s ease-in-out infinite;
}

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

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

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

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

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

  50% {
    box-shadow:
      0 4px 9px rgb(0 0 0 / 32%),
      0 0 22px rgb(251 191 36 / 72%);
    transform: translateY(-1px) scale(1.04);
  }
}

.eyeball-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: #f8fafc;
  background: #111827;
  box-shadow: 0 24px 70px rgb(0 0 0 / 62%);
}

.eyeball-final-results-dialog::backdrop {
  background: rgb(15 23 42 / 78%);
  backdrop-filter: blur(3px);
}

.eyeball-final-results-dialog h3,
.eyeball-final-results-dialog p {
  margin-top: 0;
}

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

.eyeball-final-results-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid rgb(148 163 184 / 35%);
  border-radius: 12px;
  background: rgb(15 23 42 / 72%);
}

.eyeball-final-results-table th,
.eyeball-final-results-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgb(148 163 184 / 22%);
  text-align: center;
  white-space: nowrap;
}

.eyeball-final-results-table th {
  color: #fef3c7;
  background: rgb(30 41 59 / 92%);
}

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

.eyeball-final-results-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
}

body.base-game-game-active .eyeball-room-main {
  min-height: calc(100vh - 60px);
  padding: clamp(12px, 2vw, 24px);
}

@media (max-width: 1000px),
  (min-width: 600px) and (min-height: 600px) and (max-width: 1366px) and (any-pointer: coarse) {
  .eyeball-game {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .eyeball-room .base-game-players {
    grid-template-columns: 1fr;
  }

  .eyeball-game-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .eyeball-estimate-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 521px) and (max-width: 760px) {
  .eyeball-end-condition {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .eyeball-end-condition {
    grid-template-columns: 1fr;
  }

  body.base-game-game-active .eyeball-room-main {
    padding: 12px;
  }

  .eyeball-waiting-practice-heading {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  #eyeball-canvas {
    scroll-behavior: auto;
  }

  .eyeball-final-results-button {
    animation: none;
  }
}
.eyeball-bot-settings {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
}
