/* ===== 황제를 잡아라 CSS ===== */

/* -- Design Tokens -- */
#ecardGame {
  --felt-green: #1a5c2a;
  --felt-dark: #0e3a18;
  --felt-light: #237a38;
  --wood-frame: #5c3a1e;
  --wood-highlight: #8b6914;
  --wood-shadow: #3a2210;
  --card-gold-border: #c9a84c;
  --card-gold-glow: rgba(201, 168, 76, 0.5);
  --emperor-gold: #d4a520;
  --slave-dark: #2a2a3a;
}

/* -- Main Screen -- */
#ecardGame.active {
  background:
    radial-gradient(ellipse at 50% 50%, var(--felt-light) 0%, var(--felt-green) 40%, var(--felt-dark) 100%);
  padding: 0;
  gap: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  border: 4px solid var(--wood-frame);
  box-shadow:
    inset 0 0 60px rgba(0,0,0,0.4),
    0 0 0 2px var(--wood-shadow),
    0 0 0 6px var(--wood-highlight),
    0 0 0 8px var(--wood-shadow);
}

/* Felt texture */
#ecardGame::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.015) 2px, rgba(0,0,0,0.015) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0,0,0,0.01) 2px, rgba(0,0,0,0.01) 4px);
  pointer-events: none;
  z-index: 0;
}

#ecardGame > * {
  position: relative;
  z-index: 1;
}

/* ===== COMPACT HEADER ===== */
.ecard-compact-header {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  background: linear-gradient(180deg, #5c3a1e 0%, #3a2210 100%);
  border-bottom: 2px solid #8b6914;
  box-shadow: 0 3px 8px rgba(0,0,0,0.5);
  flex-shrink: 0;
  min-height: 46px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.ecard-compact-header .back-btn {
  background: rgba(0,0,0,0.3) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 6px !important;
  color: #d4c4a0 !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0;
  font-size: 14px !important;
  padding: 0 !important;
  cursor: pointer;
}

.ecard-header-round {
  font-size: 11px;
  font-weight: 700;
  color: #d4c4a0;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Score block */
.ecard-header-score {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(201,168,76,0.35);
  border-radius: 8px;
  padding: 2px 8px;
  flex-shrink: 0;
}

.ecard-hscore-emperor,
.ecard-hscore-slave {
  font-size: 13px;
}

.ecard-hscore-val {
  font-family: 'Black Han Sans', sans-serif;
  font-size: 17px;
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255,215,0,0.5);
  min-width: 20px;
  text-align: center;
}

.ecard-hscore-div {
  font-size: 13px;
  color: rgba(255,255,255,0.35);
  padding: 0 1px;
}

/* Role badge */
.ecard-header-role {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 12px;
  border: 1.5px solid rgba(201,168,76,0.5);
  background: rgba(0,0,0,0.3);
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: #e8dcc8;
}

#ecardRoleIcon {
  font-size: 14px;
}

#ecardRoleName {
  font-size: 12px;
  font-weight: 700;
}

/* Opponent info */
.ecard-header-opp {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
  min-width: 0;
}

.ecard-header-opp .opponent-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  border: 1.5px solid rgba(201,168,76,0.4);
  flex-shrink: 0;
}

.ecard-header-opp .opponent-name {
  font-size: 12px;
  font-weight: 700;
  color: #e8dcc8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60px;
}

.ecard-header-opp .opponent-cards-count {
  font-size: 11px;
  color: rgba(200,190,160,0.6);
  white-space: nowrap;
  flex-shrink: 0;
}

.opponent-played-card {
  flex-shrink: 0;
}

.opponent-played-card .ecard-card {
  width: 30px !important;
  height: 44px !important;
  margin: 0 !important;
  cursor: default !important;
}

.opponent-played-card .ecard-card-icon {
  font-size: 14px !important;
  margin-bottom: 0 !important;
}

.opponent-played-card .ecard-card-name {
  font-size: 6px !important;
}

.opponent-played-card .ecard-card:hover {
  transform: none !important;
}

/* ===== RESULT TEXT ===== */
.ecard-result-text {
  text-align: center;
  font-family: 'Black Han Sans', sans-serif;
  font-size: 15px;
  color: #ffd700;
  padding: 4px 12px 2px;
  min-height: 22px;
  text-shadow: 0 0 10px rgba(255,215,0,0.5), 0 1px 3px rgba(0,0,0,0.6);
  flex-shrink: 0;
}

/* ===== MY CARDS AREA ===== */
.ecard-my-cards-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  padding: 0 6px;
  justify-content: center;
}

.my-cards-label {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: rgba(200,190,160,0.5);
}

/* Card hand */
.ecard-cards-hand {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 6px 4px 14px;
  flex: 1;
  min-height: 0;
}

/* ===== 플레이 영역 (인라인, 상단) ===== */
.ecard-play-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
}

/* ===== 내가 선공 후 대기 표시 ===== */
.ecard-submitted-display {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.ecard-submitted-card-big {
  width: min(60vw, 220px);
  height: min(84vw, 308px);
  border-radius: 18px;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border: 3px solid var(--card-gold-border);
  box-shadow: 0 0 50px var(--card-gold-glow), 0 12px 50px rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: min(20vw, 72px);
  opacity: 0.55;
  animation: ecMyCardSubmit 0.4s cubic-bezier(0.15, 0.85, 0.3, 1.05);
}
.ecard-submitted-card-big::before { content: '👑'; }

@keyframes ecMyCardSubmit {
  from { transform: scale(0.3) translateY(60px); opacity: 0; }
  to   { transform: scale(1)   translateY(0);    opacity: 0.55; }
}

.ecard-submitted-msg {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
}

/* ===== REVEAL 비교 영역 (인라인, 절대위치 아님) ===== */
.ecard-reveal-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
}

.ecard-reveal-cards-row {
  display: flex;
  gap: 32px;
  align-items: flex-end;
}

.ecard-reveal-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ecard-reveal-slot-label {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.06em;
}

#ecardRevealOppSlot {
  animation: ecRevealOppIn 0.42s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
#ecardRevealMySlot {
  animation: ecRevealMyIn 0.35s ease-out both;
}
@keyframes ecRevealOppIn {
  from { transform: translateY(-70px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
@keyframes ecRevealMyIn {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

#ecardRevealOppSlot.ec-exit-up {
  animation: ecRevealOppOut 0.35s ease-in forwards;
}
#ecardRevealMySlot.ec-exit-down {
  animation: ecRevealMyOut 0.35s ease-in forwards;
}
@keyframes ecRevealOppOut {
  from { transform: translateY(0);    opacity: 1; }
  to   { transform: translateY(-70px); opacity: 0; }
}
@keyframes ecRevealMyOut {
  from { transform: translateY(0);   opacity: 1; }
  to   { transform: translateY(70px); opacity: 0; }
}

/* ===== 3D 뒤집기 카드 ===== */
.ec-flip-card {
  perspective: 900px;
  width: min(38vw, 140px);
  height: min(53vw, 196px);
}

.ec-flip-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.ec-flip-inner.flipped {
  transform: rotateY(180deg);
}

.ec-flip-back,
.ec-flip-front {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.ec-flip-back {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border: 2px solid var(--card-gold-border);
  box-shadow: 0 0 18px var(--card-gold-glow);
  font-size: 30px;
  opacity: 0.6;
}
.ec-flip-back::before { content: '👑'; }

.ec-flip-front {
  transform: rotateY(180deg);
  border: 2px solid rgba(255,255,255,0.25);
}
.ec-front-emperor { background: linear-gradient(135deg, #8b6000, #d4a520); }
.ec-front-citizen  { background: linear-gradient(135deg, #1e3a6e, #2e5cb8); }
.ec-front-slave    { background: linear-gradient(135deg, #12121e, #252540); }

/* ===== 결과 뱃지 (인라인, 카드 아래·패 위) ===== */
.ecard-reveal-result {
  font-size: min(14vw, 52px);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-align: center;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.17, 0.67, 0.55, 1.5);
  text-shadow: 0 2px 20px rgba(0,0,0,0.6);
  flex-shrink: 0;
  min-height: 70px;
}
.ecard-reveal-result.ec-result-visible {
  opacity: 1;
  transform: scale(1);
}
.ecard-reveal-result.ec-result-win  { color: #ffd700; }
.ecard-reveal-result.ec-result-lose { color: #ff4444; }
.ecard-reveal-result.ec-result-draw { color: #aaa; }

/* ===== DICE ROLL OVERLAY (3D) ===== */
.ecard-dice-overlay {
  position: absolute;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 16, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: ecDiceFadeIn 0.2s ease;
}

@keyframes ecDiceFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.ecard-dice-3d-wrap {
  width: min(88vw, 360px);
  height: min(55vw, 230px);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,215,0,0.15);
}

.ecard-dice-3d-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.ecard-dice-result-badge {
  margin-top: 20px;
  font-size: 22px;
  line-height: 1.6;
  text-align: center;
  letter-spacing: 0.06em;
  color: #e8dcc8;
  font-family: 'Black Han Sans', sans-serif;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(8px);
  text-shadow: 0 0 12px rgba(255,215,0,0.4);
}

.ecard-dice-result-badge.visible {
  opacity: 1;
  transform: translateY(0);
}

.ecard-dice-result-badge.winner {
  color: #ffd700;
  text-shadow: 0 0 20px rgba(255,215,0,0.7);
}

/* ===== BET ROLE HINT ===== */
.ecard-bet-role-hint {
  text-align: center;
  font-size: 12px;
  color: rgba(200, 190, 160, 0.55);
  margin-bottom: 8px;
  margin-top: -4px;
}

/* ===== BETTING AREA ===== */
.ecard-bet-area,
.ecard-bet-response {
  padding: 10px 12px;
  margin: 4px 10px;
  background: linear-gradient(180deg, #4a3220 0%, #2e1e10 100%);
  border-radius: 10px;
  border: 1.5px solid #8b6914;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 3px 10px rgba(0,0,0,0.5);
  flex-shrink: 0;
}

.bet-label {
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  color: #e8dcc8;
  margin-bottom: 10px;
}

.bet-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.bet-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(180deg, #1a3a1a 0%, #0d260d 100%);
  border: 1px solid rgba(201,168,76,0.3);
  outline: none;
}

.bet-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fce94f, #d4a520, #b8860b);
  cursor: pointer;
  border: 2px solid #8b6914;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5), 0 0 8px rgba(255,215,0,0.3);
}

.bet-amount {
  font-family: 'Black Han Sans', sans-serif;
  font-size: 20px;
  color: #ffd700;
  min-width: 54px;
  text-align: right;
  text-shadow: 0 0 8px rgba(255,215,0,0.4);
}

.bet-proposal {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #e8dcc8;
}

.bet-proposal span {
  color: #ffd700;
  font-family: 'Black Han Sans', sans-serif;
  font-size: 17px;
}

.bet-buttons {
  display: flex;
  gap: 8px;
}

/* ===== ACTION BUTTONS ===== */
.ecard-action-buttons {
  display: flex;
  gap: 8px;
  padding: 6px 10px 10px;
  flex-shrink: 0;
}

.ecard-action-buttons .btn {
  background: linear-gradient(180deg, #3a6a3a 0%, #1a4a1a 100%);
  border: 1.5px solid #4a8a4a;
  color: #d4ecd4;
  font-family: 'Black Han Sans', sans-serif;
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 3px 6px rgba(0,0,0,0.4);
  min-height: 44px;
  flex: 1;
}

.ecard-action-buttons .btn:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.ecard-action-buttons .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== WAITING ===== */
.ecard-waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  margin: 4px 10px;
  background: rgba(0,0,0,0.25);
  border-radius: 10px;
  border: 1px solid rgba(201,168,76,0.12);
  flex-shrink: 0;
  min-height: 48px;
}

/* ===== CARD BASE ===== */
.ecard-card {
  width: 80px;
  height: 116px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.23, 1, 0.32, 1),
              box-shadow 0.25s ease;
  position: relative;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
  margin: 0 -10px;
  border: 2.5px solid var(--card-gold-border);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.ecard-card::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 6px;
  pointer-events: none;
}

.ecard-card:hover {
  transform: translateY(-12px) scale(1.05);
  z-index: 10;
  box-shadow: 0 12px 24px rgba(0,0,0,0.6), 0 0 15px var(--card-gold-glow);
}

.ecard-card:active {
  transform: translateY(-8px) scale(1.03);
}

.ecard-card.selected {
  transform: translateY(-18px) scale(1.08);
  z-index: 11;
  box-shadow: 0 16px 30px rgba(0,0,0,0.6), 0 0 25px var(--card-gold-glow), 0 0 50px rgba(255,215,0,0.2);
  border-color: #ffd700;
}

/* Emperor card */
.ecard-card-emperor {
  background: linear-gradient(145deg, #fce94f 0%, #d4a520 30%, #b8860b 70%, #d4a520 100%);
  color: #3a2210;
}

.ecard-card-emperor::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 10%;
  width: 80%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  border-radius: 50%;
}

/* Citizen card */
.ecard-card-citizen {
  background: linear-gradient(145deg, #b8c6d0 0%, #8a9bae 40%, #6a7b8e 70%, #8a9bae 100%);
  color: #1a2030;
}

/* Slave card */
.ecard-card-slave {
  background: linear-gradient(145deg, #4a4a5e 0%, #2a2a3a 40%, #1a1a28 70%, #2a2a3a 100%);
  color: #c8c8d8;
}

/* Card back */
.ecard-card-back {
  background:
    radial-gradient(ellipse at 30% 30%, rgba(255,255,255,0.08) 0%, transparent 50%),
    linear-gradient(145deg, #a02040 0%, #8b1a2b 25%, #5c0e1a 60%, #8b1a2b 100%);
  border-color: var(--card-gold-border);
  overflow: hidden;
}

.ecard-card-back::before {
  content: '황';
  position: absolute;
  font-family: 'Black Han Sans', sans-serif;
  font-size: 44px;
  color: #ffd700;
  opacity: 0.35;
  text-shadow: 0 0 12px rgba(255,215,0,0.5), 0 2px 4px rgba(0,0,0,0.5);
  z-index: 2;
}

.ecard-card-back::after {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1.5px solid rgba(201,168,76,0.3);
  border-radius: 5px;
  pointer-events: none;
  background:
    repeating-linear-gradient(45deg, transparent, transparent 6px, rgba(255,215,0,0.03) 6px, rgba(255,215,0,0.03) 7px),
    repeating-linear-gradient(-45deg, transparent, transparent 6px, rgba(255,215,0,0.03) 6px, rgba(255,215,0,0.03) 7px);
  z-index: 1;
}

/* Card icon & name */
.ecard-card-icon {
  font-size: 38px;
  margin-bottom: 4px;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4));
  position: relative;
  z-index: 3;
}

.ecard-card-name {
  font-family: 'Black Han Sans', sans-serif;
  font-size: 13px;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  position: relative;
  z-index: 3;
}

/* Battle card size */
.ecard-card-battle {
  width: 74px !important;
  height: 106px !important;
  margin: 0 !important;
  cursor: default !important;
}

.ecard-card-battle:hover {
  transform: none !important;
}

/* Small opponent card */
.ecard-card-opp-small {
  width: 30px !important;
  height: 44px !important;
  margin: 0 !important;
  cursor: default !important;
}

.ecard-card-opp-small .ecard-card-icon {
  font-size: 14px !important;
  margin-bottom: 0 !important;
}

.ecard-card-opp-small .ecard-card-name {
  font-size: 6px !important;
}

.ecard-card-opp-small:hover {
  transform: none !important;
}

/* ===== REVEAL ANIMATION ===== */
.ecard-card-reveal-anim {
  animation: ecard-flip-in 0.5s cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes ecard-flip-in {
  0%   { transform: rotateY(90deg) scale(0.8); opacity: 0; }
  60%  { transform: rotateY(-6deg) scale(1.05); opacity: 1; }
  100% { transform: rotateY(0deg) scale(1); opacity: 1; }
}

/* ===== PORTRAIT — SMALL SCREENS ===== */
@media (max-width: 400px) {
  #ecardGame { border-width: 3px; }
  .ecard-card { width: 68px; height: 100px; margin: 0 -9px; }
  .ecard-card-icon { font-size: 32px; }
  .ecard-card-name { font-size: 11px; }
  .ecard-card-back::before { font-size: 36px; }
  .ecard-hscore-val { font-size: 15px; }
}

@media (max-width: 340px) {
  .ecard-card { width: 58px; height: 84px; margin: 0 -7px; border-width: 2px; }
  .ecard-card-icon { font-size: 26px; }
  .ecard-card-name { font-size: 10px; }
  .ecard-header-opp .opponent-name { max-width: 44px; }
}

/* ===== LANDSCAPE MODE (fallback — mobile.css !important가 우선) ===== */
/* Grid: Row1=헤더, Row2=플레이영역(전폭), Row3=카드패(좌)+컨트롤(우) */
@media (orientation: landscape) and (max-height: 500px) {
  #ecardGame.active {
    display: grid;
    grid-template-columns: 1fr min(220px, 38vw);
    grid-template-rows: auto 1fr auto;
  }

  .ecard-compact-header {
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: 42px;
    padding: 3px 8px;
  }

  /* Row 2: 플레이 영역 — 전체 너비 */
  .ecard-play-area {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .ecard-result-text {
    grid-column: 1 / -1;
    grid-row: 2;
    align-self: start;
    z-index: 2;
    font-size: 13px;
    padding: 6px 10px;
    min-height: 28px;
  }
  .ecard-reveal-result {
    grid-column: 1 / -1;
    grid-row: 2;
    align-self: center;
    z-index: 2;
    font-size: min(8vw, 36px);
    min-height: 0;
  }

  /* Row 3 좌: 카드 패 */
  .ecard-my-cards-area {
    grid-column: 1;
    grid-row: 3;
    padding: 4px 8px;
  }

  /* Row 3 우: 컨트롤 (상호배타 — JS가 하나만 표시) */
  .ecard-bet-area,
  .ecard-bet-response {
    grid-column: 2;
    grid-row: 3;
    padding: 8px 10px;
    box-sizing: border-box;
    border-left: 2px solid rgba(201, 168, 76, 0.2);
  }
  .ecard-action-buttons {
    grid-column: 2;
    grid-row: 3;
    padding: 4px 8px 6px;
    border-left: 2px solid rgba(201, 168, 76, 0.2);
  }
  .ecard-action-buttons .btn { min-height: 44px; font-size: 12px; }
  .ecard-waiting {
    grid-column: 2;
    grid-row: 3;
    padding: 6px 10px;
    min-height: 44px;
    border-left: 2px solid rgba(201, 168, 76, 0.2);
  }

  /* 카드 크기 */
  .ecard-card { width: min(20vh, 80px); height: min(29vh, 116px); margin: 0 -10px; border-width: 2px; }
  .ecard-card-icon { font-size: min(11vh, 36px); }
  .ecard-card-name { font-size: 11px; }
  .ecard-card-back::before { font-size: 24px; }
  .ecard-card.selected { transform: translateY(-12px) scale(1.06); }
  .ecard-card:hover    { transform: translateY(-8px) scale(1.04); }
  .ecard-cards-hand { padding: 4px 4px 8px; }
  .my-cards-label { font-size: 10px; }

  /* 플레이 영역 내부 소형화 */
  .ecard-submitted-card-big {
    width: min(22vw, 120px);
    height: min(31vw, 168px);
    font-size: min(9vw, 50px);
    border-radius: 12px;
  }
  .ec-flip-card {
    width: min(17vw, 96px);
    height: min(24vw, 134px);
  }

  /* 주사위 오버레이 */
  .ecard-dice-3d-wrap {
    width: min(50vw, 280px);
    height: min(30vw, 160px);
    border-radius: 12px;
  }
  .ecard-dice-result-badge { margin-top: 8px; font-size: 16px; }
}
