body {
  font-family: Arial;
  text-align: center;
  background: #3a3a55;
  color: #ffffff;
  touch-action: manipulation;
}

html, body, button, #game, #buzzList {
  touch-action: manipulation;
}

.logo {
  max-width: 300px;
  margin: 20px auto;
  display: block;
}

.logoWrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 20px auto;
}

.logoIcon {
  height: 48px;
  width: auto;

  filter:
    drop-shadow(1px 0 white)
    drop-shadow(-1px 0 white)
    drop-shadow(0 1px white)
    drop-shadow(0 -1px white);
}

.logoText {
  height: 42px;
  width: auto;
}

.centerBox {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.loginMessage {
  margin-top: 10px;
  font-size: 14px;
  color: #ffb84d;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 160ms ease-out, max-height 160ms ease-out;
}

.loginMessage.show {
  opacity: 0.95;
  max-height: 60px; /* enough for one line */
}

@keyframes fadeInMsg {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 0.95; transform: translateY(0); }
}

.statusBar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 10px 0;
  font-size: 14px;
  opacity: 0.9;
}

.statusDot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.statusDotGreen { background: #2f9e44; }
.statusDotOrange { background: #ffb84d; }

.playerMessage {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  color: #ffb84d;
  font-size: 14px;
  transition: opacity 180ms ease, max-height 180ms ease;
}

.playerMessage.show {
  opacity: 0.95;
  max-height: 40px;
}

input, textarea, button {
  padding: 14px;
  margin: 10px;
  font-size: 18px;
  border-radius: 8px;
  border: none;
  width: 80%;
  max-width: 400px;
  box-sizing: border-box;
}

textarea {
  height: 90px;
}

button {
  background: #4c6ef5;
  color: white;
  cursor: pointer;
  touch-action: manipulation;
}

.buttonRow {
  display: flex;
  gap: 10px;
  margin: 10px auto 15px auto;
  width: 80%;
  max-width: 400px;
  justify-content: center;
}

.buttonRow button {
  flex: 1;
  padding: 10px;
  font-size: 16px;
}

#playerList li {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.removeBtn {
  background: transparent;
  color: red;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
}

.removeBtn:hover {
  opacity: 0.6;
}

#buzzBtn {
  height: 120px;
  font-size: 36px;
  background: #1BB625;
}

#buzzBtn:disabled {
  background: #888888;
  cursor: not-allowed;
}

.secondaryBtn {
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 14px;
  padding: 10px;
}

button.danger {
  background: #e03131;
}

button.danger:hover {
  opacity: 0.9;
}

.buzzRow {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0;
}

.buzzLine1 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.buzzLine2 {
  margin-top: 2px;
  overflow-wrap: anywhere;
  opacity: 0.85;
  color: rgba(255,255,255,0.75);
}

.playerColumns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 80%;
  max-width: 400px;
  margin: 10px auto 0 auto;
}

@media (max-width: 700px) {
  .playerColumns {
    grid-template-columns: 1fr;
  }
}

.playerColumn h3 {
  margin-bottom: 12px;
}

.cardList {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Buzz order cards */
.playerBuzzCard {
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 8px 10px;
  margin: 4px 0;
  text-align: left;
}

.playerBuzzTop {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  align-items: center;
}


/* player buzz list layout */
.playerBuzzRow {
  display: grid;
  grid-template-columns: 28px 1fr minmax(72px, auto);
  align-items: center;
  gap: 8px;          /* small overall gap (affects num↔name and name↔time) */
  margin: 4px 0;
  text-align: left;
}

.playerBuzzNum {
  text-align: right;
  opacity: 0.7;
}

.playerBuzzName {
  font-size: 15px;
  font-weight: 600;
  color: white;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playerBuzzTime {
  margin-top: 2px;
  margin-left: 36px; /* aligns under name, not under number */
  font-size: 13px;
  color: rgba(255,255,255,0.72);
}

/* Players cards */
.roomPlayerCard {
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 8px 10px;
  margin: 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.roomPlayerDot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 10px;
}

.dotOnline {
  background: #1BB625;
}

.dotOffline {
  background: #e03131;
}

.roomPlayerName {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* left side layout */
.buzzContent {
  display: grid;
  grid-template-columns: 28px 1fr; /* fixed number column */
  gap: 6px;
  flex: 1;
  min-width: 0;
  text-align: left;
}

/* number column */
.buzzNum {
  text-align: right;
  opacity: 0.7;
}

/* text block column */
.buzzTextBlock {
  min-width: 0;
}

.buzzMeta {
  white-space: nowrap;
}

.buzzText {
  flex: 1;
  text-align: left;
  overflow-wrap: anywhere;
}

/* Make icon-style buttons in lists compact (override global button styles) */
.copyBtn {
  width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  margin: 0 !important;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.15);

  line-height: 1;
}

/* Keep copy+clear grouped tightly */
.buzzActions {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  margin: 0;
}

.copyBtn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.visuallyDisabled {
  background: #888888 !important;
  cursor: not-allowed;
}

.tokenRow {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 80%;
  max-width: 400px;
}

.tokenInput {
  flex: 1;
  max-width: 240px;
  margin: 0;
}

.tokenBtn {
  width: auto;
  margin: 0;
  padding: 10px 14px;
  font-size: 16px;
}

.iconBtn {
  width: auto;
  margin: 0;
  padding: 10px 12px;
  font-size: 16px;
  background: rgba(255,255,255,0.15);
}

/* READY — green */
.stateReady {
  background: #1BB625 !important; /* green */
  cursor: pointer;
}

/* LOCKED — grey */
.stateLocked {
  background: #888888 !important;
  cursor: not-allowed;
}

/* BUZZED — blue */
.stateBuzzed {
  background: #228be6 !important; /* blue */
  cursor: not-allowed;
}

.sectionHeader {
  width: 80%;
  max-width: 400px;
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* left spacer | title | button */
  align-items: center;
  margin-top: 10px;
  user-select: none;
  cursor: pointer;
}

.sectionHeader h3 {
  grid-column: 2;
  margin: 10px 0;
  text-align: center;
}

.chevBtn {
  grid-column: 3;
  justify-self: end;

  width: auto !important;
  margin: 0 !important;
  padding: 6px 10px;
  background: rgba(255,255,255,0.12);
}

#tokenSection {
  width: 80%;
  max-width: 400px;
  overflow: hidden;
  max-height: 120px;        /* enough to show tokenRow */
  opacity: 1;
  transition: max-height 200ms ease, opacity 200ms ease;
}

#tokenSection.collapsed {
  max-height: 0;
  opacity: 0;
}

.headerActions {
  grid-column: 3;
  justify-self: end;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

h3 {
  margin-bottom: 20px;
}
#buzzList {
  padding-left: 0;
  margin-top: 0px;
}

#buzzList li {
  margin: 4px 0;        /* vertical spacing between rows */
  list-style: none;
}

.tokenRowCentered {
  justify-content: center;
}

.buzzWrap {
  width: 80%;
  max-width: 600px;   /* match playerGrid max width */
  margin: 0 auto;
}

.buzzMeta {
  white-space: nowrap;
}

.buzzText {
  flex: 1;
  overflow-wrap: anywhere;
  min-width: 0; /* important for flex wrapping */
}

.tokenRow {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.playerGrid {
  width: 80%;
  max-width: 600px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

@media (max-width: 700px) {
  .playerGrid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .playerGrid { grid-template-columns: 1fr; }
}

.playerCard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;                 /* slimmer */
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
}

.playerName {
  font-size: 14px;                  /* slightly smaller */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Small red X like before */
.removeBtn {
  width: auto !important;
  margin: 0 !important;
  padding: 2px 6px;
  background: transparent;
  color: #ff6b6b;
  border: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
}

.removeBtn:hover {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.28); /* uses your global ring feel */
}

.stateReady:hover {
  filter: brightness(1.1);
}

/* ---- GLOBAL BUTTON INTERACTION ---- */

/* Consistent hover highlight for ALL buttons */
button {
  transition: box-shadow 0.12s ease, background 0.12s ease;
}

/* Hover: same highlight regardless of button color */
button:hover {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.28);
}

/* Press feedback */
button:active {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}

/* Don't highlight non-interactive states */
.stateLocked:hover,
.stateBuzzed:hover,
.visuallyDisabled:hover,
button:disabled:hover {
  box-shadow: none;
}

ul {
  list-style: none;
  padding: 0;
}

.smallHint {
  font-size: 12px;
  opacity: 0.7;
  margin-top: -4px;
}