* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #000;
}

/* Fullscreen game canvas */
canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  background: #111;
  image-rendering: pixelated;
}

/* YUP display (top right) */
#yup-display {
  position: fixed;
  top: 8px;
  right: 10px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 999px;
  border: 1px solid #555;
  color: #ffd700;
  font-family: sans-serif;
  font-size: 13px;
  z-index: 30;
}

/* Work timer under YUP */
#work-timer {
  position: fixed;
  top: 32px;
  right: 10px;
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 6px;
  border: 1px solid #444;
  color: #eee;
  font-family: sans-serif;
  font-size: 11px;
  z-index: 25;
}

/* Chat panel (right side) */
#chat-panel {
  position: fixed;
  top: 60px; /* under YUP + timer */
  right: 10px;
  bottom: 10px;
  width: 260px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid #444;
  border-radius: 8px;
  padding: 8px;
  color: #eee;
  display: flex;
  flex-direction: column;
  font-family: sans-serif;
  font-size: 12px;
  z-index: 10;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 8px;
}

.chat-message {
  margin-bottom: 4px;
}

.chat-message .chat-author {
  font-weight: bold;
  margin-right: 4px;
}

#chat-form {
  display: flex;
}

#chat-input {
  flex: 1;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid #555;
  background: #111;
  color: #eee;
}

/* Blackjack panel */
#blackjack-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 360px;
  max-width: 95vw;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #666;
  border-radius: 10px;
  padding: 12px;
  color: #fff;
  font-family: sans-serif;
  z-index: 40;
}

#blackjack-panel h2 {
  margin: 0 0 6px;
  font-size: 16px;
  text-align: center;
}

#blackjack-status {
  font-size: 12px;
  margin-bottom: 8px;
  min-height: 16px;
}

.bj-section {
  margin-bottom: 6px;
}

.bj-label {
  font-size: 11px;
  color: #aaa;
}

#bj-player-hand,
#bj-dealer-hand {
  font-family: "Consolas", monospace;
  font-size: 14px;
  margin: 2px 0;
}

#bj-player-total,
#bj-dealer-total {
  font-size: 11px;
  color: #ccc;
}

.bj-bet-row {
  display: flex;
  gap: 6px;
  margin: 8px 0;
}

#bj-bet-input {
  flex: 1;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid #555;
  background: #111;
  color: #eee;
  font-size: 12px;
}

#bj-start-btn {
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid #555;
  background: #0b5;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
}

.bj-buttons {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.bj-buttons button {
  flex: 1;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid #555;
  background: #222;
  color: #eee;
  cursor: pointer;
  font-size: 12px;
}

.bj-buttons button:disabled {
  opacity: 0.4;
  cursor: default;
}

#bj-exit-btn {
  background: #822;
}

/* Utility */
.hidden {
  display: none;
}

/* Gamble panel (Double or Nothing) */
#gamble-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  max-width: 95vw;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #666;
  border-radius: 10px;
  padding: 12px;
  color: #fff;
  font-family: sans-serif;
  z-index: 45;
}

#gamble-panel h2 {
  margin: 0 0 6px;
  font-size: 16px;
  text-align: center;
}

#gamble-status {
  font-size: 12px;
  margin-bottom: 8px;
  min-height: 16px;
}

.gamble-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

#gamble-bet-input {
  flex: 1;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid #555;
  background: #111;
  color: #eee;
  font-size: 12px;
}

#gamble-flip-btn {
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid #555;
  background: #0b5;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
}

.gamble-help {
  font-size: 11px;
  color: #ccc;
  margin: 4px 0 8px;
}

.gamble-buttons {
  text-align: right;
}

#gamble-exit-btn {
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid #555;
  background: #822;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
}

/* Arcade panel (Eat All game) */

#arcade-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 420px;
  max-width: 95vw;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid #666;
  border-radius: 10px;
  padding: 12px;
  color: #fff;
  font-family: sans-serif;
  z-index: 50;
}

#arcade-panel h2 {
  margin: 0 0 6px;
  font-size: 16px;
  text-align: center;
}

#arcade-menu {
  font-size: 12px;
  margin-bottom: 6px;
}

.arcade-buttons-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

#arcade-menu button,
#arcade-lose button {
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid #555;
  background: #222;
  color: #eee;
  cursor: pointer;
  font-size: 12px;
}

#arcade-menu button:hover,
#arcade-lose button:hover {
  background: #333;
}

#arcade-canvas {
  display: block;
  margin: 8px auto;
  background: #000;
  border: 1px solid #444;
  image-rendering: pixelated;
}

#arcade-lose {
  text-align: center;
  font-size: 13px;
}

#arcade-final-score {
  margin: 6px 0;
}

/* Utility you already had */
.hidden {
  display: none;
}
