html, body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 0;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: url('/images/BlurryBackground.jpg');
  background-position: center;
  background-size: cover;
}

#app {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  position: relative;
}

.game-layout {
  position: relative;
  aspect-ratio: 9 / 16;
  width: min(99vw, calc(99vh * 9 / 16));
  width: min(99vw, calc(99dvh * 9 / 16));
  height: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.game-container {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  background-image: url('/images/PainterBackground.jpg?v=2');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.game-container--guesser {
  background-image: url('/images/GuesserBackground.jpg?v=3');
}

.game-container--no-background {
  background-image: none;
}

.pp-viewport {
  position: absolute;
  pointer-events: auto;
  width: 100%;
  height: 100%;
}

.pp-root {
  width: 100%;
  height: 100%;
  position: relative;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.pp-lock-interactions,
.pp-lock-interactions * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.pp-lock-interactions {
  touch-action: none;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
}

.pp-lock-interactions input,
.pp-lock-interactions textarea {
  -webkit-user-select: text;
  user-select: text;
  touch-action: manipulation;
}

.pp-lock-interactions button,
.pp-lock-interactions .pp-cell,
.pp-lock-interactions .pp-grid,
.pp-lock-interactions .pp-swatch {
  touch-action: none;
}


.pp-current-word {
  position: absolute;
  top: 24.6%;
  left: 0;
  width: 100%;
  padding: 0 7.96%;
  box-sizing: border-box;
  min-height: 5.4%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.15;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  z-index: 2;
}

.pp-round-timer {
  position: absolute;
  top: 11%;
  left: 26%;
  transform: translateX(-50%);
  min-width: 120px;
  padding: 10px 14px;
  text-align: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 28px;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  z-index: 4;
}


.pp-round-context {
  position: absolute;
  top: 1.25%;
  left: 50%;
  width: 78%;
  transform: translateX(-50%);
  text-align: center;
  color: white;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pp-round-context-line {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pp-round-context-line-1 {
  font-size: 14px;
  opacity: 0.8;
}

.pp-round-points {
  margin-left: 0.35rem;
  font-weight: 800;
  opacity: 1;
}

.pp-round-points--positive {
  color: #6dff75;
}

.pp-round-points--negative {
  color: #ff6b6b;
}

.pp-round-context-line-2 {
  font-size: 22px;
}

.pp-round-context-line-3 {
  font-size: 14px;
  opacity: 0.8;
}

.pp-round-popup {
  position: absolute;
  left: 50%;
  top: 18.2%;
  transform: translate(-50%, -50%);
  min-width: 220px;
  max-width: 80%;
  border-radius: 16px;
  padding: 12px 14px;
  text-align: center;
  background: rgba(5, 10, 18, 0.86);
  color: #ffffff;
  z-index: 12;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.5), 0 10px 24px rgba(0, 0, 0, 0.28);
}

.pp-round-popup--result {
  min-width: 320px;
  max-width: 88%;
  padding: 20px 22px;
  border-radius: 20px;
}

.pp-round-popup-title {
  font-size: 22px;
  font-weight: 800;
}

.pp-round-popup-subtitle {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.pp-round-popup-meta {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.82);
}

.pp-round-popup-counter {
  margin-top: 10px;
  font-size: 24px;
  font-weight: 800;
  color: #ffd86b;
}

.game-container--guesser .pp-round-popup {
  left: 5.28%;
  top: 66%;
  transform: none;
  width: 89.44%;
  min-width: 0;
  max-width: none;
  min-height: 14.22%;
  box-sizing: border-box;
  padding: 18px 20px;
  border-radius: 0;
  text-align: left;
  background: transparent;
  color: #ffffff;
  font-family: "Comic Sans MS", "Comic Sans", "Bradley Hand", cursive;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.9);
  box-shadow: none;
}

.game-container--guesser .pp-round-popup-title,
.game-container--guesser .pp-round-popup-subtitle,
.game-container--guesser .pp-round-popup-meta {
  color: #ffffff;
  text-align: left;
}

.pp-timeout-challenge-backdrop {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 18.2% 24px 24px;
  background: rgba(0, 0, 0, 0.5);
  z-index: 13;
}

.pp-timeout-challenge-modal {
  width: min(100%, 380px);
  border-radius: 24px;
  padding: 18px 14px 14px;
  background: rgba(18, 28, 47, 0.96);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pp-timeout-challenge-modal--waiting {
  padding: 24px 18px;
}

.pp-timeout-challenge-title {
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}

.pp-timeout-challenge-subtitle {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.82);
}

.pp-timeout-challenge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pp-timeout-challenge-button {
  border: 0;
  min-height: 96px;
  border-radius: 20px;
  padding: 12px 10px;
  color: #ffffff;
  background: linear-gradient(180deg, #8f98a8 0%, #6f7887 100%);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
  font-size: 18px;
  font-weight: 800;
}

.pp-timeout-challenge-button:disabled {
  opacity: 1;
}

.pp-timeout-challenge-button--correct {
  background: linear-gradient(180deg, #4ad57f 0%, #2ea75f 100%);
  box-shadow: 0 10px 22px rgba(46, 167, 95, 0.35);
}

.pp-timeout-challenge-button--wrong {
  background: linear-gradient(180deg, #ff7f7f 0%, #d65252 100%);
  box-shadow: 0 10px 22px rgba(214, 82, 82, 0.35);
}

.pp-timeout-challenge-word {
  text-align: center;
  line-height: 1.15;
}

.pp-final-shell {
  position: absolute;
  left: 4.4%;
  top: 5%;
  width: 83.9%;
  max-height: 62%;
  border-radius: 24px;
  padding: 20px 18px;
  background: rgba(18, 28, 47, 0.92);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 12;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.5), 0 18px 36px rgba(0, 0, 0, 0.35);
}

.pp-final-title {
  font-size: 28px;
  font-weight: 800;
  text-align: center;
}

.pp-final-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
}

.pp-final-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
}

.pp-final-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 700;
}

.pp-own-player-name {
  color: #8ec8ff;
}

.pp-final-row--gain {
  color: #7cff79;
  background: rgba(124, 255, 121, 0.12);
}

.pp-final-row--loss {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.12);
}

.pp-final-row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pp-final-score-delta {
  color: #7cff79;
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.pp-final-score-delta--loss {
  color: #ff6b6b;
}

.pp-final-score-delta--none {
  color: rgba(255, 255, 255, 0.45);
  text-shadow: none;
}

.pp-final-fart {
  border: 0;
  border-radius: 14px;
  padding: 8px 12px;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(180deg, #7b9cff 0%, #5d7ae0 100%);
  box-shadow: 0 8px 18px rgba(93, 122, 224, 0.3);
}

.pp-final-action {
  border: 0;
  border-radius: 18px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(180deg, #7b9cff 0%, #5d7ae0 100%);
  box-shadow: 0 8px 18px rgba(93, 122, 224, 0.3);
}


.pp-reveal-button,
.pp-skip,
.pp-clear,
.pp-fill {
  border: none;
  background-color: transparent;
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}


.pp-reveal-button {
  position: absolute;
  left: 63%;
  top: 10.7%;
  width: 36%;
  height: 6%;
}

.pp-skip {
  position: absolute;
  right: 0;
  top: 0;
  width: 32%;
  height: 100%;
}

.pp-grid {
  position: absolute;
  display: grid;
  gap: 0;
  padding: 0;
  top: 19.3%;
  left: 9.25%;
  width: 81.5%;
  aspect-ratio: 1 / 1;
  touch-action: none;
  user-select: none;
  z-index: 1;
  overflow: visible;
}

.pp-palette {
  position: absolute;
  top: 75.3%;
  left: 7.96%;
  width: 86%;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 0;
  z-index: 3;
}

.pp-swatch {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: none;
  padding: 0;
  cursor: pointer;
  background-color: transparent;
  background-size: 72% 72%, 100% 100%;
  background-position: center, center;
  background-repeat: no-repeat;
}

.pp-swatch.selected {
  background-image: url('/images/PaintingPaletteActive.png');
  background-size: 125%;
}

.pp-clear,
.pp-fill {
  position: absolute;
  bottom: 2.4%;
  width: 40%;
  height: 5.16%;
  font-size:22px;
}

.pp-fill {
  left: 31%;
  transform: translateX(-50%);
}

.pp-clear {
  left: 76%;
  transform: translateX(-50%);
}

.pp-end-round {
  position: absolute;
  right: 7.96%;
  top: 26.8%;
  width: 28%;
  height: 3.8%;
  border: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  background: url('/images/PaintingButtonNormal.png') center / 100% 100% no-repeat;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  z-index: 3;
}

.pp-end-round:active {
  background-image: url('/images/PaintingButtonPressed.png');
}

.pp-guesser-shell {
  position: absolute;
  inset: 0;
}

.pp-guesser-shell .pp-round-timer {
  top: 4.8%;
}

.pp-guesser-shell .pp-grid {
  top: 14%;
}

.pp-guesser-brush {
  position: absolute;
  width: 19.5%;
  aspect-ratio: 1 / 1;
  left: 50%;
  top: 50%;
  transform: translate(0, 0);
  background: url('/images/PainterBrush.png') center / contain no-repeat;
  pointer-events: none;
  z-index: 6;
  transition: left 120ms linear, top 120ms linear;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.45));
}

.pp-guesser-painter-name {
  position: absolute;
  left: 25.19%;
  top: 60.05%;
  width: 49.81%;
  height: 2.86%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
  color: #ffffff;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  z-index: 4;
}

.pp-word-choice-shell {
  position: absolute;
  left: 7.96%;
  top: 18.2%;
  width: 83.9%;
  z-index: 12;
}

.pp-word-choice-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 4;
}

.pp-word-choice-modal {
  border-radius: 24px;
  padding: 18px 14px 14px;
  background: rgba(18, 28, 47, 0.94);
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.5), 0 18px 36px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pp-word-choice-title {
  text-align: center;
  color: #ffffff;
  font-size: 24px;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.pp-word-choice-subtitle {
  text-align: center;
  color: rgba(255, 255, 255, 0.86);
  font-size: 16px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

.pp-word-choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.pp-word-choice-button {
  border: 0;
  min-height: 140px;
  border-radius: 20px;
  padding: 16px 12px;
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  background: linear-gradient(180deg, #7b9cff 0%, #5d7ae0 100%);
  box-shadow: 0 10px 22px rgba(93, 122, 224, 0.35);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.pp-word-choice-word {
  font-size: 22px;
  font-weight: 800;
}

.pp-word-choice-hint {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.9;
}

.pp-word-choice-button--right {
  background: linear-gradient(180deg, #ff8aa0 0%, #e4647f 100%);
  box-shadow: 0 10px 22px rgba(228, 100, 127, 0.35);
}

.pp-reroll-button {
  border: 0;
  height: 56px;
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  color: #333333;
  text-align: center;
  background-color: #c0c000;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.pp-reroll-button:hover {
  background-color: #d0d000;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

.pp-reroll-button:active {
  background-color: #b0b000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.pp-guesser-label,
.pp-guesser-subtitle {
  position: absolute;
  left: 7.96%;
  width: 83.9%;
  text-align: center;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.pp-guesser-label {
  top: 18.5%;
  font-size: 22px;
  font-weight: 800;
}

.pp-guesser-subtitle {
  top: 22.5%;
  font-size: 14px;
  font-weight: 600;
}

.pp-guesser-shell .pp-round-context {
  left: 5.28%;
  top: 66%;
  width: 89.44%;
  height: 14.22%;
  transform: none;
  box-sizing: border-box;
  padding: 18px 20px;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  text-align: left;
  color: #ffffff;
  font-family: "Comic Sans MS", "Comic Sans", "Bradley Hand", cursive;
  font-weight: 700;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.9);
  z-index: 4;
}

.pp-guesser-shell .pp-round-context-line {
  justify-content: flex-start;
  text-align: left;
}

.pp-guesser-shell .pp-round-context-line-1,
.pp-guesser-shell .pp-round-context-line-2,
.pp-guesser-shell .pp-round-context-line-3 {
  color: #ffffff;
  font-size: 22px;
  opacity: 1;
  gap: 0.4rem;
  width: 100%;
}

.pp-guesser-guess-button {
  position: absolute;
  left: 50%;
  bottom: 0.2%;
  transform: translateX(-50%);
  width: 36%;
  height: 17.4%;
  border: none;
  border-radius: 0;
  padding: 0;
  color: transparent;
  font-size: 0;
  text-shadow: none;
  background-color: transparent;
  background: url('/images/BuzzerNormal.png') center bottom / contain no-repeat;
  z-index: 4;
}

.pp-guesser-guess-button:active:not(:disabled) {
  background-image: url('/images/BuzzerPressed.png');
}

.pp-guesser-guess-button:disabled {
  opacity: 0.55;
}

.pp-guesser-joker-action,
.pp-guesser-annoy-action {
  position: absolute;
  bottom: 2.2%;
  width: 16%;
  height: 10%;
  border: none;
  padding: 0;
  color: transparent;
  font-size: 0;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  z-index: 4;
}

.pp-guesser-joker-action {
  left: 4%;
  background-image: url('/images/JokerIcon.png');
}

.pp-guesser-annoy-action {
  right: 4%;
  background-image: url('/images/AnnoyIcon.png');
}

.pp-guesser-score {
  position: absolute;
  top: 3.8%;
  right: 4.6%;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(18, 28, 47, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  z-index: 5;
}

.pp-guesser-buzzer-overlay {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: 0%;
  transform: translateX(-50%);
  width: 36%;
  max-height: 21%;
  object-fit: contain;
  object-position: center bottom;
  z-index: 5;
  pointer-events: none;
}

.pp-annoy-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 7;
}

.pp-annoy-overlay img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pp-annoy-sign {
  position: absolute;
  bottom: 14%;
  left: 18%;
  width: 64%;
  text-align: center;
  color: #ffffff;
  font-size: clamp(16px, 3.4vw, 30px);
  font-weight: 900;
  line-height: 1.1;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
}

.pp-grid--readonly {
  pointer-events: none;
}

.pp-grid--readonly .pp-cell {
  border: 0;
}

.pp-round-modal-backdrop {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(7, 15, 27, 0.68);
  z-index: 10;
}

.pp-round-modal {
  width: min(100%, 360px);
  max-height: 70%;
  padding: 22px 18px 18px;
  border-radius: 24px;
  background: rgba(18, 28, 47, 0.96);
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.5), 0 18px 36px rgba(0, 0, 0, 0.35);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.pp-round-modal-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.pp-round-modal-copy {
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
}

.pp-round-modal--decision {
  width: min(100%, 420px);
  max-height: none;
}

.pp-round-decision-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pp-round-decision-button {
  border: 0;
  border-radius: 18px;
  min-height: 118px;
  padding: 14px 12px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pp-round-decision-button--correct {
  background: linear-gradient(180deg, #4ad57f 0%, #2ea75f 100%);
  box-shadow: 0 10px 22px rgba(46, 167, 95, 0.35);
}

.pp-round-decision-button--wrong {
  background: linear-gradient(180deg, #ff7f7f 0%, #d65252 100%);
  box-shadow: 0 10px 22px rgba(214, 82, 82, 0.35);
}

.pp-round-decision-button--locked {
  background: linear-gradient(180deg, #95a0b3 0%, #6f7a8e 100%) !important;
  box-shadow: 0 8px 18px rgba(32, 39, 54, 0.35) !important;
  cursor: not-allowed;
}

.pp-round-decision-title {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
}

.pp-round-decision-points {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.pp-rules-backdrop {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.5);
  z-index: 20;
  backdrop-filter: blur(2px);
}

.pp-rules-modal {
  width: min(100%, 380px);
  max-height: 85%;
  padding: 28px 24px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(18, 28, 47, 0.98) 0%, rgba(25, 40, 65, 0.98) 100%);
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.5), 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pp-rules-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.pp-rules-title {
  margin: 0;
  font-size: 32px;
  font-weight: 900;
  background: linear-gradient(135deg, #a8d5ff 0%, #7b9cff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pp-rules-timer {
  font-size: 16px;
  font-weight: 700;
  color: rgba(168, 213, 255, 0.9);
  white-space: nowrap;
  padding: 8px 12px;
  background: rgba(91, 122, 224, 0.2);
  border-radius: 12px;
  border: 1px solid rgba(123, 156, 255, 0.3);
}

.pp-rules-content {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  overflow-y: auto;
  flex: 1;
  max-height: 450px;
}

.pp-rules-content strong {
  color: #a8d5ff;
  font-weight: 700;
}

.pp-rules-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 16px;
}

.pp-rules-players-acknowledged {
  font-size: 13px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
}

.pp-rules-button {
  border: 0;
  border-radius: 18px;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(180deg, #5ba3ff 0%, #4a8be0 100%);
  box-shadow: 0 8px 20px rgba(75, 139, 224, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pp-rules-button:hover {
  background: linear-gradient(180deg, #6db5ff 0%, #5b9ce0 100%);
  box-shadow: 0 12px 28px rgba(75, 139, 224, 0.5);
  transform: translateY(-2px);
}

.pp-rules-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(75, 139, 224, 0.3);
}

.pp-rules-button:disabled {
  background: #cccccc;
  box-shadow: 0 4px 12px rgba(200, 200, 200, 0.3);
  cursor: not-allowed;
  opacity: 0.6;
}

.pp-rules-button:disabled:hover {
  background: #cccccc;
  box-shadow: 0 4px 12px rgba(200, 200, 200, 0.3);
  transform: none;
}

.pp-cell {
    position: relative;
    background-color: transparent;
    border: 1px solid rgba(150, 150, 150, 0.3);
    cursor: pointer;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    transition: opacity 0.1s;
}

.pp-cell--yellow,
.pp-cell--orange {
    overflow: visible;
}

.pp-cell--yellow.pp-cell--painted::after,
.pp-cell--orange.pp-cell--painted::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: scale(1.6);
    transform-origin: center;
    background-image: var(--cell-dot-big-image);
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    pointer-events: none;
    z-index: 0;
}

.pp-cell--painted::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: var(--cell-color);
    background-image: var(--cell-dot-image);
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-blend-mode: var(--cell-dot-blend-mode, multiply);
    pointer-events: none;
    z-index: 1;
}

.pp-cell:hover {
    opacity: 0.8;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding: 0;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0-idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI26My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA9NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTk5MjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDg2IDYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.lobby-shell {
	position: absolute;
	inset: 0;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 2.2%;
 overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.lobby-card {
	background: rgba(18, 28, 47, 0.82);
	border: 2px solid rgba(255, 255, 255, 0.16);
	border-radius: 24px;
	box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
	backdrop-filter: blur(8px);
	color: #fff;
}

.lobby-card--header {
	padding: 16px 18px;
	text-align: center;
}

.lobby-card--hero,
.lobby-card--players,
.lobby-card--activity {
	padding: 18px;
}

.lobby-card--hero {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.lobby-card--players {
 flex: 0 0 auto;
  overflow: visible;
}

.lobby-card--activity {
  flex: 0 0 auto;
  overflow: visible;
}

.lobby-title {
	font-size: 24px;
	font-weight: 800;
	line-height: 1.1;
}

.lobby-subtitle,
.lobby-room-label,
.lobby-player-tag,
.lobby-note,
.lobby-activity-empty {
	font-size: 13px;
	line-height: 1.3;
	color: rgba(255, 255, 255, 0.8);
}

.lobby-heading,
.lobby-section-title {
	margin: 0;
	font-weight: 800;
	line-height: 1.1;
}

.lobby-heading {
	font-size: 26px;
}

.lobby-section-title {
	font-size: 18px;
	margin-bottom: 12px;
}

.lobby-copy {
	margin: 0;
	font-size: 14px;
	line-height: 1.4;
	color: rgba(255, 255, 255, 0.86);
}

.lobby-label {
	font-size: 13px;
	font-weight: 700;
	color: rgba(255, 255, 255, 0.82);
}

.lobby-input {
	border: 0;
	border-radius: 16px;
	padding: 14px 16px;
  margin-bottom: 12px;
	font-size: 16px;
	background: rgba(255, 255, 255, 0.96);
	color: #13203b;
}

.lobby-input[readonly] {
	text-overflow: ellipsis;
}

.lobby-action,
.lobby-secondary,
.lobby-fart {
	border: 0;
	border-radius: 18px;
	padding: 14px 16px;
	font-weight: 800;
	font-size: 15px;
	color: #fff;
	background: linear-gradient(180deg, #f96b74 0%, #d84b53 100%);
	box-shadow: 0 8px 18px rgba(216, 75, 83, 0.35);
}

.lobby-secondary,
.lobby-fart {
	padding-inline: 18px;
	background: linear-gradient(180deg, #7b9cff 0%, #5d7ae0 100%);
	box-shadow: 0 8px 18px rgba(93, 122, 224, 0.3);
}

button.lobby-secondary {
  margin-bottom: 20px;
}

.lobby-invite-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.lobby-options {
  margin: 6px 0 8px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
}

.lobby-options-summary {
  margin-bottom: 0;
  cursor: pointer;
  list-style: none;
}

.lobby-options-summary::-webkit-details-marker {
  display: none;
}

.lobby-options-summary::after {
  content: "▾";
  float: right;
  opacity: 0.9;
}

.lobby-options:not([open]) .lobby-options-summary::after {
  content: "▸";
}

.lobby-options-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.lobby-option-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

.lobby-qr {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.lobby-qr-image {
  display: block;
  width: 180px;
  height: 180px;
  padding: 10px;
  border-radius: 18px;
  background: #ffffff;
}

.lobby-error {
	padding: 12px 14px;
	border-radius: 14px;
	font-size: 13px;
	font-weight: 700;
	background: rgba(255, 114, 114, 0.18);
	color: #ffd1d1;
}

.lobby-player-list,
.lobby-activity-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
 overflow: visible;
}

.lobby-player-row,
.lobby-activity-entry {
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.09);
}

.lobby-player-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
}

.lobby-player-row--host {
  background: linear-gradient(135deg, rgba(255, 213, 92, 0.24), rgba(255, 255, 255, 0.1));
  border: 1px solid rgba(255, 213, 92, 0.55);
  box-shadow: 0 6px 18px rgba(255, 193, 7, 0.16);
}

.lobby-player-row--host .lobby-player-name {
  color: #ffe58a;
}

.lobby-host-crown {
  display: inline-block;
  margin-right: 6px;
  color: #ffd34f;
  font-size: 19px;
  line-height: 1;
  text-shadow: 0 1px 4px rgba(255, 193, 7, 0.65);
}

.lobby-host-subtitle {
  margin-top: 3px;
  color: #ffe58a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.lobby-player-name {
	font-size: 17px;
	font-weight: 700;
	line-height: 1.2;
}

.lobby-activity-entry {
	padding: 12px 14px;
	font-size: 14px;
	line-height: 1.35;
	color: rgba(255, 255, 255, 0.88);
}

.lobby-activity-entry.highlight {
	background: rgba(249, 107, 116, 0.26);
}

.pp-debug-panel {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 1%;
  max-height: 12%;
  overflow: auto;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(5, 10, 18, 0.8);
  z-index: 20;
  pointer-events: none;
}

.pp-debug-entry {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 11px;
	line-height: 1.25;
	color: #ffd9b3;
}

@keyframes pulse-scale {
	0% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.2);
	}
	100% {
		transform: scale(1);
	}
}

.countdown-pulse {
	animation: pulse-scale 0.6s ease-in-out;
}

.countdown-critical {
	color: #ff0000;
	font-weight: bold;
}

@media (max-width: 480px) {
  .lobby-shell {
    padding: 20px;
  }

  .lobby-title {
    font-size: 22px;
  }

  .lobby-heading {
    font-size: 24px;
  }
}
