/* Crazy Eights page. Builds on styles.css (buttons, top bar, dialogs, chat, toast). */

body.c8 { height: auto; min-height: 100vh; min-height: 100dvh; overflow: auto; }
.c8 {
  --c8-red: #d6453b; --c8-yellow: #e9b43a; --c8-green: #3a9f62; --c8-blue: #3a72c9;
}
.c8-main {
  flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 16px;
  display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start;
}
.c8-create { grid-column: 1 / -1; max-width: 440px; margin: 24px auto; }
.c8-create .btn { width: 100%; }

.c8-game { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.c8-players { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.c8-players li {
  display: flex; flex-direction: column; padding: 8px 12px; min-width: 96px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line); font-size: 13.5px;
}
.c8-players li span { color: var(--muted); font-size: 12.5px; }
.c8-players li.turn { border-color: var(--brass); box-shadow: 0 0 0 2px rgba(217, 179, 106, .3); }
.c8-players li.me b { color: var(--brass-2); }
.c8-players li.away { opacity: .55; }
.c8-players li.empty { border-style: dashed; }
.c8-players li.last-card { border-color: var(--c8-red); }
.c8-players .last-tag { color: var(--c8-red); font-weight: 800; }
.c8-players .bot-tag { font-style: normal; font-size: 11px; color: var(--muted); border: 1px solid currentColor; border-radius: 6px; padding: 0 4px; }
.c8-players li { position: relative; }
.c8-players li:has(.remove-bot) { padding-right: 24px; }
.c8-players .remove-bot { position: absolute; top: 2px; right: 4px; background: none; border: 0; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 2px; cursor: pointer; }

.c8-center {
  display: flex; align-items: center; justify-content: center; gap: 22px; padding: 22px 12px;
  border-radius: 22px; background: radial-gradient(circle at 50% 40%, var(--felt-1), var(--felt-2));
  border: 1px solid var(--line); min-height: 170px;
}
.c8-pile {
  width: 84px; height: 124px; border-radius: 12px; cursor: pointer; position: relative;
  border: 3px solid #fff2; color: #fff; font-weight: 800;
  background: repeating-linear-gradient(45deg, var(--back-1) 0 8px, var(--back-2) 8px 16px);
  box-shadow: 3px 3px 0 #0004, 6px 6px 0 #0003;
}
.c8-pile span { position: absolute; bottom: 6px; right: 8px; font-size: 12px; opacity: .85; }
.c8-pile:not(:disabled) { outline: 2px solid var(--brass-2); outline-offset: 3px; }
.c8-pile:disabled { cursor: default; }
.c8-color { display: flex; align-items: center; gap: 6px; font-weight: 700; text-transform: capitalize; color: #fff; }
.c8-color .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; }
.dot.red { background: var(--c8-red); } .dot.yellow { background: var(--c8-yellow); }
.dot.green { background: var(--c8-green); } .dot.blue { background: var(--c8-blue); }

.c8-status { margin: 0; text-align: center; font-weight: 700; min-height: 1.5em; }
.c8-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; min-height: 38px; }
.c8-actions .btn { min-width: 120px; min-height: 46px; }

/* Cards: a colored face with a white oval and the symbol in the middle. */
.c8-card {
  --c: #333; position: relative; flex: none; width: 70px; height: 104px; padding: 0;
  border-radius: 10px; border: 3px solid #fff; background: var(--c); color: #fff;
  font: 800 15px/1 var(--ui); box-shadow: 0 4px 10px rgba(0, 0, 0, .35); user-select: none;
}
.c8-card.red { --c: var(--c8-red); } .c8-card.yellow { --c: var(--c8-yellow); }
.c8-card.green { --c: var(--c8-green); } .c8-card.blue { --c: var(--c8-blue); }
.c8-card.wild { background: conic-gradient(var(--c8-red) 0 25%, var(--c8-yellow) 0 50%, var(--c8-green) 0 75%, var(--c8-blue) 0); }
.c8-card .mid {
  position: absolute; inset: 22% 12%; display: grid; place-items: center; border-radius: 50%;
  background: #fff; color: var(--c); font-size: 26px; transform: rotate(-18deg);
}
.c8-card.wild .mid { color: #222; }
.c8-card .corner { position: absolute; top: 5px; left: 6px; font-size: 13px; text-shadow: 0 1px 0 #0006; }
.c8-card .corner.end { top: auto; left: auto; bottom: 5px; right: 6px; }
.c8-discard .c8-card { width: 84px; height: 124px; }

.c8-hand { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 4px 0 8px; }
button.c8-card { cursor: pointer; transition: transform .12s; }
button.c8-card[aria-disabled="true"] { filter: brightness(.6) saturate(.7); cursor: default; }
button.c8-card.playable:hover, button.c8-card.playable:focus-visible { transform: translateY(-6px); outline: none; }

.c8-log { list-style: none; margin: 0; padding: 0; text-align: center; color: var(--muted); font-size: 13px; }

.c8-scores { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.c8-scores h2 { margin: 0 0 4px; font-size: 15px; }
.c8-scores p { margin: 0 0 8px; font-size: 12.5px; }
.c8-scores ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.c8-scores li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.c8-scores li span { color: var(--muted); white-space: nowrap; }
.c8-scores li.me b { color: var(--brass-2); }

.c8-chat {
  display: flex; flex-direction: column; height: min(520px, 70dvh);
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.c8-chat .log b { color: var(--brass-2); margin-right: 4px; }

.c8-colors { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.c8-swatch { min-height: 56px; border: 0; border-radius: 12px; font-weight: 800; color: #fff; cursor: pointer; text-shadow: 0 1px 0 #0006; }
.c8-swatch.red { background: var(--c8-red); } .c8-swatch.yellow { background: var(--c8-yellow); }
.c8-swatch.green { background: var(--c8-green); } .c8-swatch.blue { background: var(--c8-blue); }

@media (max-width: 760px) {
  .c8-main { grid-template-columns: 1fr; padding: 12px; }
  .c8-center { gap: 14px; padding: 16px 8px; min-height: 0; }
  .c8-card { width: 56px; height: 84px; }
  .c8-card .mid { font-size: 20px; }
  .c8-pile, .c8-discard .c8-card { width: 70px; height: 104px; }
  .c8-hand { gap: 6px; }
  .c8-chat { height: 300px; }
}

/* Sound on/off: icon only so it fits next to Invite on phones. */
.c8 .sound-btn { padding: 0 10px; min-width: 40px; font-size: 1rem; }
