:root {
  --bg: #f7f4ef;
  --ink: #111;
  --panel: #fff;
  --accent: #f0c400;
  --accent-edge: #c49a00;
  --line: #111;
  --muted: #666;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Tahoma, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.page {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 16px;
}

.picker label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 4px;
  color: var(--muted);
}

.picker select {
  min-width: 220px;
  height: 40px;
  padding: 0 10px;
  border: 2px solid var(--line);
  background: var(--panel);
  font: inherit;
}

.game {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  background: var(--panel);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding-left: 20px;
  background: var(--accent);
  border: 6px solid var(--line);
  border-bottom: 0;
}

.toolbar h2 {
  margin: 0;
  font-size: 1rem;
}

.timer {
  display: flex;
  height: 100%;
  align-items: center;
  font-weight: 700;
}

.timer span {
  display: flex;
  align-items: center;
  height: 100%;
}

#seconds {
  padding-right: 12px;
}

.timer button {
  width: 48px;
  height: 100%;
  border: 0;
  border-left: 2px solid var(--line);
  background: transparent;
  font-size: 1rem;
  cursor: pointer;
}

.timer button i {
  font-style: normal;
}

.crossword-icon-pause::before {
  content: "❚❚";
}

.crossword-icon-play::before {
  content: "▶";
}

.crossword-wrapper {
  position: relative;
  border: 2px solid var(--line);
  background: #fff;
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
}

.crossword-wrapper.is-blocked {
  filter: blur(3px);
  pointer-events: none;
}

#crosswordBoard {
  display: block;
}

.modal {
  position: absolute;
  inset: 0;
  display: none;
  background: rgba(255, 255, 255, 0.92);
  z-index: 5;
}

.modal:not(.hidden) {
  display: block;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: 300px;
  padding: 20px;
  position: absolute;
  left: 50%;
  top: 96px;
  transform: translateX(-50%);
  background: var(--panel);
  border: 2px solid var(--line);
  text-align: center;
}

.modal-card span {
  font-weight: 700;
  font-size: 1.25rem;
}

.modal-card p {
  margin: 16px 0 0;
  font-size: 0.9rem;
}

.modal-card .actions {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.modal-card button {
  height: 56px;
  padding: 0 20px;
  border: 0;
  border-bottom: 4px solid var(--accent-edge);
  background: var(--accent);
  font: inherit;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
}

.boot-error {
  margin: 0;
  padding: 12px 16px;
  background: #ffe8e8;
  border-bottom: 2px solid #c00;
  color: #800;
}

.image-credit-badge {
  position: absolute;
  z-index: 4;
  width: 24px;
  height: 24px;
}

.image-credit-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: transparent;
  box-shadow: none;
  cursor: help;
}

.image-credit-tooltip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  display: none;
  width: 240px;
  padding: 10px 12px;
  border: 1px solid #111;
  color: #fff;
  background: rgba(17, 17, 17, 0.96);
  box-shadow: none;
  font-size: 0.75rem;
  line-height: 1.4;
}

.image-credit-tooltip::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 100%;
  border: 6px solid transparent;
  border-top-color: rgba(17, 17, 17, 0.96);
}

.image-credit-tooltip strong,
.image-credit-tooltip span,
.image-credit-tooltip a {
  display: block;
}

.image-credit-tooltip a {
  margin-top: 5px;
  color: #fff;
  text-decoration: underline;
}

.image-credit-badge:hover .image-credit-tooltip,
.image-credit-badge:focus-within .image-credit-tooltip {
  display: block;
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .picker select {
    min-width: 0;
    width: 100%;
  }

}
