/* UNO 板块样式：牌桌走炉石传说风——深色毡面、金边、头像框、发光按钮；
   选模式等面板仍沿用本站 Apple 风格。卡牌用纯 CSS 画，不引外部图片。 */
.uno-table {
  position: relative;
  background: #0b3d2a;
  background: radial-gradient(ellipse at 50% 38%, #177a52 0%, #0b3d2a 55%, #052013 100%);
  border: 3px solid #c9a227;
  outline: 1px solid #7a5c14; outline-offset: 4px;
  border-radius: 24px;
  padding: 16px;
  color: #f5e9c8;
  box-shadow: inset 0 0 60px rgba(0,0,0,.55), 0 12px 32px rgba(0,0,0,.35);
  overflow: hidden;
}
.uno-table .muted, .uno-table .small { color: #d8cba0; }
.uno-opponents {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  margin-bottom: 12px;
}
.uno-opp {
  min-width: 110px; flex: 1 1 120px; max-width: 190px;
  background: rgba(12, 12, 24, .55);
  border: 1px solid rgba(201,162,39,.45);
  border-radius: 14px; padding: 10px 10px 8px; text-align: center;
  color: #f5e9c8;
}
.uno-opp.active {
  border-color: #ffd700;
  box-shadow: 0 0 18px rgba(255,215,0,.55);
  animation: opp-pulse 1.2s ease-in-out infinite;
}
@keyframes opp-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(255,215,0,.35); }
  50% { box-shadow: 0 0 20px rgba(255,215,0,.65); }
}
.uno-opp.won { border-color: #ffd700; background: rgba(201,162,39,.22); }
.uno-opp .avatar {
  width: 44px; height: 44px; margin: 0 auto 6px;
  border-radius: 50%; border: 2px solid #c9a227;
  background: radial-gradient(circle at 35% 30%, #3a3a55, #14141f);
  color: #ffd700; font-family: Georgia, 'Times New Roman', serif;
  font-size: 20px; font-weight: 700; line-height: 40px; text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.uno-opp .nm { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uno-opp .ct { font-size: 13px; opacity: .9; }
.uno-opp .exposed { color: #ff8a7a; font-size: 13px; font-weight: 700; margin-top: 2px; }
.uno-opp .mini-cards { font-size: 15px; letter-spacing: 2px; margin-top: 2px; }
.uno-center {
  display: flex; gap: 18px; align-items: center; justify-content: center;
  flex-wrap: wrap; margin: 6px 0 12px;
}
.uno-pile { text-align: center; }
.uno-pile .lbl { font-size: 12px; opacity: .85; margin-bottom: 6px; color: #e8dcc0; }
.uno-status {
  text-align: center; font-size: 16px; font-weight: 700;
  font-family: Georgia, 'Times New Roman', serif; color: #ffd700;
  text-shadow: 0 2px 6px rgba(0,0,0,.6);
  min-height: 24px; margin-bottom: 8px;
}
.uno-log {
  background: rgba(0,0,0,.35); border: 1px solid rgba(201,162,39,.35); border-radius: 10px;
  padding: 8px 12px; font-size: 13px; line-height: 1.6; color: #efe6c8;
  max-height: 96px; overflow-y: auto; margin-bottom: 12px;
}
.uno-hand-label { font-size: 14px; font-weight: 600; margin-bottom: 8px; color: #f5e9c8; }
.uno-hand {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  min-height: 118px; align-items: flex-start;
}
.uno-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.uno-actions .btn { background: #fff; color: #1d1d1f; border-color: transparent; }
.uno-actions .btn-primary {
  background: linear-gradient(180deg, #ffe27a, #c9a227) !important; color: #3a2a00 !important;
  border-color: #8a6d1f !important; font-weight: 700 !important;
  box-shadow: 0 2px 10px rgba(201,162,39,.45);
}
.uno-actions .btn-danger { background: #fff; color: #d92d20; }
.uno-btn-uno { background: #f2b705 !important; color: #1d1d1f !important; font-weight: 700 !important; }
.uno-btn-uno.armed { box-shadow: 0 0 0 3px #fff, 0 0 0 5px #f2b705; }
.uno-btn-catch {
  background: linear-gradient(180deg, #ff7a6b, #d92d20) !important; color: #fff !important;
  font-weight: 700 !important; border-color: #8a1d12 !important;
  animation: catch-blink 1s ease-in-out infinite;
}
@keyframes catch-blink {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,80,60,.55); }
  50% { box-shadow: 0 0 0 5px rgba(255,80,60,.35); }
}
/* 战报旁的抓包条：有人没喊 UNO 时直接在战报下面显示，手机上不用找按钮 */
.catch-inline {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 8px; padding: 8px 12px; border-radius: 12px;
  background: linear-gradient(180deg, #ff7a6b, #d92d20); color: #fff;
  font-weight: 700; font-size: 15px;
  animation: catch-blink 1s ease-in-out infinite;
}
.catch-inline .btn { flex: none; }

/* 出牌特效：弃牌堆顶弹一下，功能牌出中央大横幅 */
#unoEffect {
  position: absolute; left: 50%; top: 36%; z-index: 5;
  transform: translate(-50%, -50%) scale(.6);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 44px; font-weight: 800; color: #ffd700;
  text-shadow: 0 2px 0 #7a5c14, 0 4px 16px rgba(0,0,0,.7);
  opacity: 0; pointer-events: none; white-space: nowrap;
}
#unoEffect.show { animation: uno-banner 1s ease forwards; }
@keyframes uno-banner {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  40% { transform: translate(-50%, -50%) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}
.uno-card.pop { animation: uno-pop .45s ease; }
@keyframes uno-pop {
  0% { transform: scale(1.35) rotate(6deg); }
  100% { transform: scale(1) rotate(0); }
}

/* 卡牌：64×96，圆角 10px；金边 + 渐变牌面 */
.uno-card {
  width: 64px; height: 96px; flex: 0 0 auto;
  border-radius: 10px; border: 2px solid #d4af37;
  color: #fff; cursor: pointer; position: relative;
  font-weight: 700; user-select: none;
  box-shadow: 0 4px 10px rgba(0,0,0,.5), inset 0 0 0 2px rgba(255,255,255,.14);
  transition: transform .12s;
  display: flex; align-items: center; justify-content: center;
}
.uno-card:hover { transform: translateY(-8px); }
.uno-card .corner {
  position: absolute; top: 4px; left: 6px; font-size: 13px; line-height: 1;
}
.uno-card .corner.br { top: auto; left: auto; bottom: 4px; right: 6px; transform: rotate(180deg); }
.uno-card .face { font-size: 26px; line-height: 1; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.uno-card .face.small { font-size: 19px; }
.uno-card.red { background: linear-gradient(160deg, #e8443a, #a31d16); }
.uno-card.yellow { background: linear-gradient(160deg, #f7c948, #c78f06); }
.uno-card.green { background: linear-gradient(160deg, #1d9e6b, #0b5c40); }
.uno-card.blue { background: linear-gradient(160deg, #2f8fe0, #0b4d8f); }
.uno-card.wild { background: linear-gradient(160deg, #3a3a44, #14141a); }
.uno-card.back {
  background: linear-gradient(160deg, #23233a, #101018); cursor: default;
  background-image: repeating-linear-gradient(45deg, rgba(212,175,55,.25) 0 8px, transparent 8px 16px);
}
.uno-card.back .face { font-size: 22px; letter-spacing: 1px; color: #ffd700; }
.uno-card.playable { box-shadow: 0 0 0 3px #ffd700, 0 0 16px rgba(255,215,0,.6), 0 2px 6px rgba(0,0,0,.35); }
.uno-card.dim { opacity: .55; cursor: default; }
.uno-card.dim:hover { transform: none; }
.uno-card.lg { width: 76px; height: 112px; }
.uno-card.lg .face { font-size: 32px; }
@media (max-width: 480px) {
  .uno-card { width: 54px; height: 82px; }
  .uno-card .face { font-size: 22px; }
  .uno-card.lg { width: 64px; height: 96px; }
}

/* 选颜色弹窗 */
.uno-modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.uno-modal-box {
  background: #fff; border-radius: 18px; padding: 24px;
  max-width: 420px; width: 100%; text-align: center;
  border: 2px solid #c9a227;
  box-shadow: 0 16px 48px rgba(0,0,0,.45);
  animation: win-pop .35s ease;
}
@keyframes win-pop {
  0% { transform: scale(.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.uno-color-row { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.uno-color-btn {
  width: 64px; height: 64px; border-radius: 14px; border: 2px solid rgba(0,0,0,.12);
  cursor: pointer; color: #fff; font-weight: 700; font-size: 15px;
}
.uno-cover {
  text-align: center; padding: 48px 16px;
}
.uno-cover .big { font-size: 40px; }
.mode-card { cursor: pointer; }
.mode-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,113,227,.25); }
.name-row { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.name-row .input { flex: 1; }
.room-code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 32px; font-weight: 700; letter-spacing: .2em; text-align: center;
}

/* 联机聊天：左下角固定面板，只在联机对局时显示 */
.uno-chat {
  position: fixed; left: 12px; bottom: 12px; z-index: 100;
  width: min(340px, calc(100vw - 24px));
  background: #fff; border: 1px solid var(--hairline); border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  overflow: hidden;
}
.uno-chat-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; background: var(--surface2);
  border-bottom: 1px solid var(--hairline);
  font-size: 14px; font-weight: 600;
}
.uno-chat-toggle {
  border: 1px solid var(--border); background: #fff; color: var(--dim);
  border-radius: var(--pill); padding: 4px 12px; font-size: 13px; cursor: pointer;
}
.uno-chat.collapsed .uno-chat-body { display: none; }
.uno-chat-log {
  height: 180px; overflow-y: auto; padding: 10px 12px;
  font-size: 14px; line-height: 1.5;
}
.uno-chat-log .chat-msg { margin-bottom: 8px; word-break: break-word; }
.uno-chat-log .chat-msg .who { font-size: 12px; color: var(--dim); }
.uno-chat-log .chat-msg img { width: 72px; height: 72px; object-fit: contain; vertical-align: middle; }
.uno-chat-log .chat-sys { color: var(--dim); font-size: 13px; text-align: center; }
.uno-chat-picker {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px;
  max-height: 180px; overflow-y: auto; padding: 8px;
  border-top: 1px solid var(--hairline); background: var(--surface2);
}
.uno-chat-picker img {
  width: 100%; aspect-ratio: 1; object-fit: contain;
  cursor: pointer; border-radius: 8px; background: #fff;
}
.uno-chat-picker img:hover { outline: 2px solid var(--accent-bright); }
.uno-chat-input {
  display: flex; gap: 6px; padding: 8px;
  border-top: 1px solid var(--hairline); align-items: center;
}
.uno-chat-input .input { flex: 1 1 auto; min-width: 0; min-height: 36px; padding: 8px 14px; font-size: 14px; }
.uno-chat-input .btn { flex: 0 0 auto; }

/* 翻转版深色面颜色 */
.uno-card.pink { background: linear-gradient(160deg, #f27ba7, #c2185b); }
.uno-card.teal { background: linear-gradient(160deg, #14b8a6, #0f766e); }
.uno-card.orange { background: linear-gradient(160deg, #fb923c, #c2410c); }
.uno-card.purple { background: linear-gradient(160deg, #a78bfa, #6d28d9); }

/* ---- 手机端：七圣召唤式布局（一屏能看全：对手变横条、手牌扇形单行、战报可收、聊天变底部抽屉） ---- */
@media (max-width: 768px) {
  .uno-modal { z-index: 10001; }
  .uno-chat { z-index: 10000; }
  .uno-table { padding: 10px; border-radius: 16px; outline-offset: 2px; }
  /* 对手条：一行横向滚动的小芯片，不再竖着堆大卡 */
  .uno-opponents { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; gap: 6px; margin-bottom: 8px; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
  .uno-opp { flex: 0 0 auto; min-width: 0; max-width: none; display: flex; align-items: center; gap: 6px; padding: 5px 9px 5px 5px; text-align: left; }
  .uno-opp .avatar { width: 28px; height: 28px; margin: 0; font-size: 14px; line-height: 24px; flex: 0 0 auto; }
  .uno-opp .nm { font-size: 12px; max-width: 64px; }
  .uno-opp .ct { font-size: 12px; white-space: nowrap; }
  .uno-opp .exposed { margin-top: 0; font-size: 12px; }
  .uno-opp .mini-cards { display: none; }
  .uno-status { font-size: 14px; margin-bottom: 6px; }
  .uno-center { gap: 10px; margin: 4px 0 8px; }
  .uno-pile .lbl { font-size: 11px; }
  .uno-card.lg { width: 58px; height: 86px; }
  .uno-card.lg .face { font-size: 26px; }
  /* 战报：默认只露两行，点一下展开 */
  .uno-log { max-height: 42px; overflow: hidden; cursor: pointer; margin-bottom: 8px; }
  .uno-log.expanded { max-height: 160px; overflow-y: auto; }
  .uno-hand-label { font-size: 13px; margin-bottom: 6px; }
  /* 手牌：单行横向滚动、重叠扇形 */
  .uno-hand { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; gap: 0; min-height: 96px; padding: 4px 4px 8px; -webkit-overflow-scrolling: touch; }
  .uno-hand .uno-card { margin-left: -14px; }
  .uno-hand .uno-card:first-child { margin-left: 0; }
  .uno-card { width: 52px; height: 78px; }
  .uno-card .face { font-size: 21px; }
  .uno-actions { gap: 6px; margin-top: 10px; }
  .uno-actions .btn { padding: 8px 12px; font-size: 14px; }
  #unoEffect { font-size: 30px; }
  /* 聊天：底部抽屉，收起时只剩左下角一个小 pill */
  .uno-chat { left: 0; right: 0; bottom: 0; width: auto; max-height: 55vh; border-radius: 18px 18px 0 0; display: flex; flex-direction: column; }
  .uno-chat.collapsed { left: 12px; right: auto; bottom: 12px; width: auto; max-width: calc(100vw - 24px); border-radius: 18px; }
  .uno-chat-log { height: 120px; }
  .uno-chat-picker { grid-template-columns: repeat(4, 1fr); max-height: 140px; }
}
