/**
 * Mind Game - Playing Cards & Screenshot Rules Styling
 * Faithfully recreates the visual aesthetics of the game rules diagrams
 */

:root {
  --felt-green: #0d4029;
  --felt-green-dark: #072618;
  --felt-green-light: #125436;
  --card-gold: #f4b41a;
  --card-gold-light: #fbe094;
  --card-blue: #1c3b6d;
  --card-blue-light: #345c99;
  --card-red: #c92a2a;
  --card-red-border: #b02525;
  --panel-bg: #f8faf9;
  --panel-tint: #eaf3ed;
  --text-dark: #1b262c;
  --text-muted: #5a6b74;
}

/* Base Playing Card */
.card-ui {
  position: relative;
  width: 72px;
  height: 104px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #dcdcdc;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px;
  user-select: none;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.card-ui.interactive {
  cursor: pointer;
}

.card-ui.interactive:hover {
  transform: translateY(-6px) scale(1.04);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  border-color: #ffd166;
}

.card-ui.selected {
  outline: 3px solid #ffbe0b;
  transform: translateY(-8px);
  box-shadow: 0 0 16px rgba(255, 190, 11, 0.7);
}

/* Card Back (Facedown) */
.card-ui.facedown {
  background: repeating-linear-gradient(
    45deg,
    #1e3d59,
    #1e3d59 8px,
    #172f45 8px,
    #172f45 16px
  );
  border: 3px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.card-ui.facedown::after {
  content: '♦';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 26px;
  color: rgba(255, 255, 255, 0.3);
}

/* Corner indices */
.card-corner {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.card-corner.top-left {
  align-self: flex-start;
}

.card-corner.bottom-right {
  align-self: flex-end;
  transform: rotate(180deg);
}

.card-rank {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.card-suit {
  font-size: 14px;
}

.card-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 30px;
  opacity: 0.95;
}

.card-points-tag {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #718096;
}

/* Suit Colors */
.card-ui.red, .card-ui[data-suit="D"], .card-ui[data-suit="H"] {
  color: #d90429;
}
.card-ui.black, .card-ui[data-suit="S"], .card-ui[data-suit="C"] {
  color: #1a1a24;
}

/* Hand cards */
.my-card-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

.slot-label {
  font-size: 11px;
  font-weight: 700;
  color: #c9e6d4;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Small Cards for Opponent View */
.card-ui.mini {
  width: 44px;
  height: 64px;
  border-radius: 5px;
  padding: 3px;
}
.card-ui.mini .card-rank {
  font-size: 12px;
}
.card-ui.mini .card-suit {
  font-size: 10px;
}
.card-ui.mini .card-center {
  font-size: 18px;
}

/* Large Card for Draw & Action Modals */
.card-ui.large {
  width: 105px;
  height: 152px;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}
.card-ui.large .card-rank {
  font-size: 26px;
}
.card-ui.large .card-suit {
  font-size: 20px;
}
.card-ui.large .card-center {
  font-size: 46px;
}

/* ==========================================================================
   SCREENSHOT RULES & DIAGRAMS STYLING
   ========================================================================== */

.rules-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
}

.rule-card-item {
  background: #ffffff;
  border-radius: 18px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0,0,0,0.06);
}

/* Left Card Badge */
.rule-card-badge {
  flex-shrink: 0;
  width: 60px;
  height: 86px;
  background: #ffffff;
  border-radius: 9px;
  border: 2px solid #b71c1c;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  color: #b71c1c;
}

.rule-card-badge .badge-rank {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.rule-card-badge .badge-suit {
  font-size: 20px;
  line-height: 1;
  margin-top: 2px;
}

/* Rule Body */
.rule-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rule-card-title {
  font-size: 15px;
  font-weight: 800;
  color: #0b2216;
  line-height: 1.35;
}

/* Diagram Box (Matches screenshot's light green rounded box) */
.rule-diagram-box {
  background: #edf5f0;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 58px;
}

/* Diagram Components */
.diagram-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.diagram-cards-row {
  display: flex;
  gap: 4px;
  align-items: center;
}

.diagram-label {
  font-size: 11px;
  color: #2b3a42;
  font-weight: 600;
}

/* Diagram Mini Cards */
.diag-card {
  width: 22px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
}

/* Yellow Mini Card (You / Your cards) */
.diag-card.yellow {
  background: #eab308;
  border: 1px solid #ca8a04;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* Blue Mini Card (Other / Opponents) */
.diag-card.blue {
  background: repeating-linear-gradient(
    45deg,
    #1e3a8a,
    #1e3a8a 3px,
    #172554 3px,
    #172554 6px
  );
  border: 1px solid #0f172a;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* Red Outline Mini Card (Jack & King numbered) */
.diag-card.red-outline {
  background: #ffffff;
  border: 1.5px solid #dc2626;
  color: #dc2626;
  font-size: 11px;
  font-weight: 700;
}

/* Deck Icon for King */
.diag-card.deck {
  background: #991b1b;
  border: 1.5px solid #7f1d1d;
  color: #ffffff;
  font-size: 10px;
}

/* Arrow in Diagram */
.diag-arrow {
  color: #dc2626;
  font-size: 18px;
  font-weight: 900;
}

.diag-icon {
  font-size: 20px;
}
