:root {
  --bg: #0f172a;
  --card-bg: #1e293b;
  --text: #f1f5f9;
  --accent: #38bdf8;
  --red: #ef4444;
  --blue: #3b82f6;
  --green: #22c55e;
  --yellow: #eab308;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 12px;
}

header {
  text-align: center;
  padding: 8px 0;
}

.title {
  font-size: 1.3rem;
  font-weight: 700;
}

#status {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-top: 4px;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hand-area {
  background: rgba(255,255,255,0.04);
  border-radius: 16px;
  padding: 10px;
}

.hand-area .label {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-bottom: 8px;
}

.hand {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 70px;
  align-items: center;
}

.table {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 16px 0;
  position: relative;
}

.pile {
  text-align: center;
}

.pile .label {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-bottom: 6px;
}

.card {
  width: 56px;
  height: 84px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  user-select: none;
  transition: transform 0.15s ease;
}

.card.back {
  background: linear-gradient(135deg, #1e3a5f, #0f172a);
  border: 2px solid #334155;
  color: #94a3b8;
  font-size: 0.7rem;
}

.card.empty {
  background: transparent;
  border: 2px dashed #334155;
  color: #64748b;
  box-shadow: none;
}

.card.playable {
  cursor: pointer;
}

.card.playable:active {
  transform: scale(0.95);
}

.card.red    { background: var(--red); color: white; }
.card.blue   { background: var(--blue); color: white; }
.card.green  { background: var(--green); color: white; }
.card.yellow { background: var(--yellow); color: #1e293b; }
.card.wild, .card.wild4 {
  background: linear-gradient(135deg, #a855f7, #ec4899);
  color: white;
}

.color-indicator {
  position: absolute;
  bottom: -8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid white;
  opacity: 0;
}

.color-indicator.visible {
  opacity: 1;
}

.message {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.9);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.message.show {
  opacity: 1;
}

footer {
  display: flex;
  gap: 10px;
  padding-bottom: 12px;
}

button {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #0f172a;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#btn-uno {
  background: #f97316;
  color: white;
  flex: 0.6;
}

/* Small screens */
@media (max-width: 360px) {
  .card {
    width: 48px;
    height: 72px;
    font-size: 0.85rem;
  }
}
