body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, 'Apple Color Emoji', 'Segoe UI Emoji';
  background: #0b1220;
  color: #e5e7eb;
  -webkit-user-select: none; /* Chrome, Safari */
  -moz-user-select: none;    /* Firefox */
  -ms-user-select: none;     /* IE/Edge */
  user-select: none;
}
h1 { text-align: center; padding: 12px 10px; margin: 0; }
textarea { text-align: center; }

.controls { max-width: 980px; margin: 0 auto; padding: 0 12px 12px; }
.controls form { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.controls input[type="text"] {
  padding: 10px 12px;
  background: #111827;
  color: #f3f4f6;
  border: 1px solid #374151;
  border-radius: 8px;
  min-width: 280px;
}
.controls button {
  padding: 10px 14px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.controls button:hover { background:#1d4ed8; }
.hint { color:#94a3b8; text-align:center; margin: 8px 0 0; }
.status { text-align:center; color:#93c5fd; min-height: 22px; }
.games { display:grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap:10px; margin-top:10px; }
.game-card { background:#111827; border:1px solid #374151; border-radius:10px; padding:10px; display:flex; flex-direction:column; gap:8px; }
.game-card img { width:100%; height:80px; object-fit:cover; border-radius:6px; }
.game-card .title { font-size:14px; color:#e5e7eb; }
.game-card .meta { font-size:12px; color:#9ca3af; }

.tier { display:flex; align-items:center; margin: 6px; overflow: hidden; }
.label { 
  max-width: 120px; 
  height: 86px;
  text-align: center; 
  font-weight: 700; 
  font-size: 20px; 
  padding: 10px; 
  color: #fff; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  flex-shrink: 0;
}
.tier-input {
  background: transparent;
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: 20px;
  text-align: center;
  width: 100%;
  height: auto;
  min-height: 20px;
  max-height: 120px;
  outline: none;
  padding: 0;
  resize: none;
  overflow: hidden;
  line-height: 1.2;
  word-wrap: break-word;
  white-space: pre-wrap;
  transition: font-size 0.2s ease;
  box-sizing: border-box;
}
.tier-input:focus {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
.row { flex: 1; min-height: 90px; background: #0f172a; display: flex; align-items: center; padding: 8px; gap: 8px; flex-wrap: wrap; }
.S .label { background:#ef4444; }
.A .label { background:#f97316; }
.B .label { background:#facc15; color:#000; }
.B .tier-input { color:#000; }
.C .label { background:#22c55e; }
.D .label { background:#3b82f6; }
.card { width: 179px; height: 80px; background: #e2e8f0; border-radius: 6px; overflow: hidden; cursor: grab; position: relative; }
.card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  word-wrap: break-word;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.card:hover .card-overlay {
  opacity: 1;
}

@media (max-width: 640px){
  .label { width: 48px; min-width:48px; font-size:16px; }
  .row { min-height: 72px; }
  .card { width:64px; height:64px; }
}

