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

body {
  background: #0a0a0f;
  color: #fff;
  font-family: 'Segoe UI', sans-serif;
  min-height: 100vh;
}

header {
  background: #111118;
  border-bottom: 3px solid #f0b90b;
  padding: 20px 16px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

header h1 {
  font-size: clamp(20px, 5vw, 32px);
  font-weight: 900;
  margin-bottom: 16px;
}

header h1 span {
  color: #f0b90b;
}

.search-bar {
  display: flex;
  gap: 8px;
  max-width: 550px;
  margin: 0 auto;
}

.search-bar input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 8px;
  border: 2px solid #333;
  background: #1a1a24;
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: border 0.2s;
  min-width: 0;
}

.search-bar input:focus {
  border-color: #f0b90b;
}

.search-bar button {
  padding: 12px 20px;
  background: #f0b90b;
  border: none;
  border-radius: 8px;
  color: #000;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.search-bar button:hover {
  background: #d4a009;
}

main {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 12px;
}

#status {
  text-align: center;
  font-size: 14px;
  color: #aaa;
  margin-bottom: 20px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.coin-card {
  background: #111118;
  border: 1px solid #222;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.coin-card:hover {
  transform: translateY(-4px);
  border-color: #f0b90b;
  box-shadow: 0 8px 24px rgba(240,185,11,0.15);
}

.coin-card:active {
  transform: scale(0.97);
}

.coin-card img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.coin-card-info {
  flex: 1;
}

.coin-card-info h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}

.coin-card-info p {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
}

.coin-card-right {
  text-align: right;
}

.coin-price {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.coin-change {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

.up {
  color: #00c853;
  background: #00c85315;
}

.down {
  color: #ff1744;
  background: #ff174415;
}

/* Detail */
.hidden {
  display: none !important;
}

#detailView {
  padding: 16px 12px;
  max-width: 800px;
  margin: 0 auto;
}

.detail-container > button {
  background: transparent;
  border: 2px solid #f0b90b;
  color: #f0b90b;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
  transition: all 0.2s;
}

.detail-container > button:hover {
  background: #f0b90b;
  color: #000;
}

.detail-card {
  background: #111118;
  border: 1px solid #222;
  border-radius: 16px;
  padding: 24px;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.detail-header img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
}

.detail-header h2 {
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 900;
}

.symbol {
  color: #888;
  font-size: 14px;
  text-transform: uppercase;
}

.change-badge {
  margin-left: auto;
  font-size: 16px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 20px;
}

.price-box {
  background: #0a0a0f;
  border: 1px solid #222;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  text-align: center;
}

.price-label {
  display: block;
  color: #888;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.price {
  font-size: clamp(28px, 6vw, 42px);
  font-weight: 900;
  color: #f0b90b;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.info-item {
  background: #0a0a0f;
  border: 1px solid #1a1a24;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label {
  font-size: 10px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.info-item span:last-child {
  font-size: 14px;
  color: #ddd;
  font-weight: 600;
}

.desc {
  color: #aaa;
  font-size: 14px;
  line-height: 1.8;
  border-left: 3px solid #f0b90b;
  padding-left: 14px;
}

@media (min-width: 480px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
  }
}