* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: #0d1117;
  color: #e6edf3;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  padding: 10px;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 0 4px;
  flex-shrink: 0;
}

h1 {
  font-size: 1.2rem;
  font-weight: 600;
}

.status {
  font-size: 0.8rem;
  color: #3fb950;
  font-weight: 500;
}

.status.stale {
  color: #f85149;
}

#grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

a.card {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: background 0.4s ease, border-color 0.2s ease;
  overflow: hidden;
  position: relative;
}

.card:hover {
  border-color: #484f58;
}

.card.flash-up  { background: rgba(63, 185, 80, 0.1); }
.card.flash-down { background: rgba(248, 81, 73, 0.1); }

.head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.symbol {
  font-size: 1rem;
  font-weight: 700;
  color: #c9d1d9;
}

.price {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.change {
  font-size: 0.75rem;
  font-weight: 600;
}

.change.up   { color: #3fb950; }
.change.down { color: #f85149; }

/* Tablet portrait */
@media (min-width: 600px) {
  body { padding: 12px; }
  #grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .card { padding: 10px 14px; }
  .price { font-size: 1.8rem; }
  .symbol { font-size: 1.05rem; }
  .change { font-size: 0.8rem; }
}

/* Tablet landscape */
@media (min-width: 900px) {
  body { padding: 14px; }
  #grid { grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .card { padding: 12px 16px; }
  .price { font-size: 2.2rem; }
  .symbol { font-size: 1.1rem; }
  .change { font-size: 0.85rem; }
}

/* Desktop */
@media (min-width: 1200px) {
  body { padding: 16px 20px; }
  #grid { gap: 10px; }
  .card { padding: 14px 20px; }
  .price { font-size: 2.8rem; }
  .symbol { font-size: 1.2rem; }
  .change { font-size: 0.95rem; }
}

/* Large desktop */
@media (min-width: 1600px) {
  body { padding: 20px 28px; }
  #grid { gap: 12px; }
  .card { padding: 18px 24px; }
  .price { font-size: 3.4rem; }
  .symbol { font-size: 1.3rem; }
  .change { font-size: 1rem; }
}
