/* 扑克牌视觉 */

.card {
  --cw: 66px;
  --ch: 94px;
  position: relative;
  flex: 0 0 auto;
  width: var(--cw);
  height: var(--ch);
  border-radius: 7px;
  background: linear-gradient(160deg, #ffffff 0%, #f4f1e8 62%, #e9e4d6 100%);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(0, 0, 0, 0.14);
  color: #1c1c1c;
  user-select: none;
  overflow: hidden;
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s;
  transform-origin: 50% 100%;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 12%, rgba(255, 255, 255, 0.85), transparent 55%);
  pointer-events: none;
}

.card.red { color: #c8202c; }
.card.black { color: #17202a; }

.card .corner {
  position: absolute;
  left: 4px;
  top: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.card .corner .rank {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

.card .corner .suit { font-size: 13px; margin-top: 1px; }

.card .pip {
  position: absolute;
  right: 6px;
  bottom: 4px;
  font-size: 30px;
  opacity: 0.9;
  line-height: 1;
}

.card.small { --cw: 44px; --ch: 62px; border-radius: 5px; }
.card.small .corner { left: 3px; top: 1px; }
.card.small .corner .rank { font-size: 14px; }
.card.small .corner .suit { font-size: 9px; }
.card.small .pip { font-size: 20px; right: 4px; bottom: 2px; }

.card.tiny { --cw: 40px; --ch: 56px; border-radius: 5px; }
.card.tiny .corner { left: 3px; top: 1px; }
.card.tiny .corner .rank { font-size: 13px; }
.card.tiny .corner .suit { font-size: 9px; }
.card.tiny .pip { font-size: 18px; right: 3px; bottom: 1px; }

/* 王 */
.card.joker .corner .rank { font-size: 13px; letter-spacing: 0; }
.card.joker .pip { font-size: 26px; }
.card.small.joker .pip, .card.tiny.joker .pip { font-size: 18px; }

.card.joker-big { background: linear-gradient(160deg, #fffdf4, #ffeec2 70%, #f7dc9a); }
.card.joker-small { background: linear-gradient(160deg, #f7f9ff, #e6ebf5 70%, #d5dceb); }

/* 牌背 */
.card.back {
  background:
    repeating-linear-gradient(45deg, #b8232f 0 5px, #9d1b26 5px 10px),
    #a41d29;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45), inset 0 0 0 2px rgba(255, 255, 255, 0.5),
    inset 0 0 0 5px #7d1420;
}

.card.back::after {
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.16), transparent 62%);
}

.card.back .corner, .card.back .pip { display: none; }
