
body {
  font-family: Arial, sans-serif;
  background: #1d3557;
  margin: 0;
  padding: 25px;
}

.container {
  max-width: 1100px;
  margin: auto;
  background: white;
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.12);
}

h1, h2 {
  text-align: center;
  color: #1d3557;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 25px;
}

input, select, button {
  padding: 10px;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid #bbb;
}

button {
  background: #2a9d8f;
  color: white;
  border: none;
  cursor: pointer;
}

button:hover {
  background: #21867a;
}

.info-box {
  background: #f1faee;
  padding: 15px;
  border-left: 5px solid #2a9d8f;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 17px;
}

.reference-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.ref-item {
  padding: 12px 16px;
  background: #dbeafe;
  border-radius: 8px;
  font-weight: bold;
}

.active {
  background: #f4a261;
  color: white;
}

.memory {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 25px 0;
}

.frame {
  width: 100px;
  height: 90px;
  border-radius: 12px;
  background: #e5e7eb;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 32px;
  font-weight: bold;
  border: 3px solid #999;
}

.hit {
  background: #b7e4c7;
  border-color: #2d6a4f;
}

.fault {
  background: #ffc9c9;
  border-color: #d00000;
}

.replaced {
  background: #ffb703;
  border-color: #fb8500;
}

.status {
  text-align: center;
  font-size: 22px;
  font-weight: bold;
  margin: 15px 0;
}

.explanation {
  text-align: center;
  background: #f8f9fa;
  padding: 15px;
  border-radius: 10px;
  font-size: 17px;
  margin-bottom: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 25px;
}

th, td {
  border: 1px solid #ccc;
  padding: 9px;
  text-align: center;
}

th {
  background: #1d3557;
  color: white;
}

.summary {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.card {
  background: #f1faee;
  padding: 15px 25px;
  border-radius: 10px;
  font-weight: bold;
}

.legend{
    display:flex;
    justify-content:center;
    gap:25px;
    margin:20px 0;
    flex-wrap:wrap;
}

.legend-item{
    display:flex;
    align-items:center;
    gap:8px;
    font-size:15px;
}

.legend-box{
    width:18px;
    height:18px;
    border-radius:4px;
    border:2px solid #555;
}

.legend-box.hit{
    background:#4CAF50;
}

.legend-box.fault{
    background:#FF6B6B;
}

.legend-box.replaced{
    background:#FFD54F;
}