:root{
  --bg:#0f1221; 
  --card:#171a2e; 
  --muted:#9aa3b2; 
  --fg:#e8ecf5;
  --brand:#7c8cff; 
  --brand2:#5ce1e6; 
  --danger:#ff6b6b; 
  --border:#242947;
}

*{box-sizing:border-box}

html,body{
  margin:0;
  padding:0;
  background:linear-gradient(135deg,#0e1020,#0b0f2b);
  color:var(--fg);
  font-family:Inter,system-ui,Segoe UI,Arial,sans-serif;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 20px;
  border-bottom:1px solid var(--border);
  background:rgba(15,18,33,.7);
}

.brand{
  font-weight:800;
  background:linear-gradient(90deg,var(--brand),var(--brand2));
  -webkit-background-clip:text;
  color:transparent;
  font-size:20px;
}

.container{
  max-width:1280px;
  margin:30px auto;
  padding:0 16px;
}

h1{
  font-size:26px;
  margin:8px 0 16px;
}

.grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
  gap:16px;
}

.card{
  background:linear-gradient(180deg,rgba(124,140,255,.06),rgba(92,225,230,.03));
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
}

/* Schöne Server-Ansicht */
.server-main-card {
  background: linear-gradient(180deg, rgba(124,140,255,.08), rgba(92,225,230,.04));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}

.server-header {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.server-map {
  flex: 1;
}

.server-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--fg);
  margin-top: 8px;
}

.server-timer {
  text-align: right;
}

.timer-display {
  font-size: 28px;
  font-weight: 800;
  color: var(--brand);
  margin-top: 8px;
}

.server-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.info-item {
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 12px;
  padding: 16px;
}

.value-with-copy {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.server-ip, .server-uuid {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
  flex: 1;
  min-width: 0;
  word-break: break-all;
}

.op-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--brand);
  margin-top: 8px;
}

.copy-btn {
  background: linear-gradient(90deg, rgba(124,140,255,.15), rgba(92,225,230,.15));
  border: 1px solid rgba(124,140,255,.3);
  color: var(--fg);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: linear-gradient(90deg, rgba(124,140,255,.25), rgba(92,225,230,.25));
  border-color: var(--brand);
}

.server-actions {
  display: flex;
  justify-content: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.1);
}

.btn-stop {
  background: linear-gradient(90deg, rgba(255,107,107,.15), rgba(255,107,107,.1));
  border: 2px solid rgba(255,107,107,.4);
  color: #ffd5d5;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-stop:hover {
  background: linear-gradient(90deg, rgba(255,107,107,.25), rgba(255,107,107,.15));
  border-color: var(--danger);
}

.description-card {
  background: linear-gradient(180deg, rgba(92,225,230,.06), rgba(124,140,255,.04));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
}

.description-text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 12px;
}

.crash-card {
  background: linear-gradient(180deg, rgba(255,107,107,.08), rgba(255,107,107,.04));
  border: 1px solid rgba(255,107,107,.3);
  border-radius: 12px;
  padding: 16px;
}

.crash-title {
  color: #ffd5d5;
  font-weight: 600;
  margin-bottom: 8px;
}

.crash-info {
  color: var(--muted);
  font-size: 14px;
}

.map-title{
  font-weight:700;
  margin:6px 0;
}

.meta{
  color:var(--muted);
  font-size:14px;
  margin-bottom:6px;
}

.btn{
  padding:10px 14px;
  border-radius:10px;
  border:1px solid var(--border);
  background:#151936;
  color:var(--fg);
  cursor:pointer;
  transition: all 0.2s ease;
}

.btn:hover {
  background:#1a1e42;
  border-color:var(--brand);
}

.actions{
  display:flex;
  gap:10px;
  margin-top:10px;
}

.danger{
  background:rgba(255,107,107,.12);
  border:1px solid rgba(255,107,107,.4);
  color:#ffd5d5;
}

.danger:hover {
  background:rgba(255,107,107,.18);
}

.ghost{
  background:transparent;
  color:var(--muted);
}

.ghost:hover {
  background:rgba(255,255,255,.05);
  color:var(--fg);
}

.value{
  font-size:18px;
  font-weight:700;
}

.code{
  font-family:ui-monospace,Menlo,Consolas,monospace;
}

.label{
  color:var(--muted);
  font-size:12px;
  margin-bottom:4px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:0.5px;
}

/* Hidden */
.hidden{display:none}

/* Empty state */
.empty{
  color:var(--muted);
  padding:20px;
  text-align:center;
  border:1px dashed var(--border);
  border-radius:12px;
}

/* Modal */
.modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.6);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:20;
}

.modal.hidden{display:none}

.modal-content{
  width:min(900px,92vw);
  background:linear-gradient(180deg,rgba(124,140,255,.1),rgba(92,225,230,.05));
  border:1px solid var(--border);
  border-radius:12px;
  overflow:hidden;
}

.modal-body{
  display:grid;
  grid-template-columns:1.2fr 1fr;
}

.modal-img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.modal-info{
  padding:14px;
}

/* Overlay */
.overlay{
  position:fixed;
  inset:0;
  background:rgba(9,12,24,.75);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:30;
}

.overlay.hidden{display:none}

.loader{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:12px;
  padding:18px 22px;
  min-width:280px;
  text-align:center;
}

.spinner{
  width:36px;
  height:36px;
  border-radius:50%;
  border:3px solid rgba(255,255,255,.12);
  border-top-color:#fff;
  margin:0 auto 10px;
  animation:spin 1s linear infinite;
}

@keyframes spin{
  to{transform:rotate(360deg)}
}

/* Karten konsistent */
.grid .card { 
  display:flex; 
  flex-direction:column; 
  min-height: 320px; 
}

.card .thumb { 
  width:100%; 
  aspect-ratio: 16/9; 
  object-fit:cover; 
  border-radius:8px; 
}

.card .body { 
  display:flex; 
  flex-direction:column; 
  gap:8px; 
  flex:1; 
}

.card .actions { 
  margin-top:auto; 
}

/* Toast mittig unten, grün */
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(8px);
  z-index: 60;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(46, 204, 113, .65);
  background: rgba(46, 204, 113, .12);
  color: #dfffe9;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}

.toast.show { 
  opacity: 1; 
  transform: translateX(-50%) translateY(0); 
}

/* OP-Badge */
.op-badge {
  display: inline-block;
  background: rgba(124,140,255,0.15);
  color: var(--brand);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  margin-left: 8px;
  font-weight: 600;
}

.grid-desc {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  margin: 8px 0;
}

/* OP Input Styling */
#opNameInput {
  transition: border-color 0.2s;
  text-align: left;
  width: 100%;
  margin-bottom: 8px;
}

#opNameInput:focus {
  outline: none;
  border-color: var(--brand);
  background: #1a1e42;
}

#opNameInput::placeholder {
  color: var(--muted);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 12px;
  }
  
  .server-header {
    grid-template-columns: 1fr;
    text-align: left;
  }
  
  .server-timer {
    text-align: left;
  }
  
  .server-info-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-body {
    grid-template-columns: 1fr;
  }
  
  .modal-img {
    max-height: 200px;
  }
  
  .value-with-copy {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .grid {
    grid-template-columns: 1fr;
  }
  
  .server-title {
    font-size: 20px;
  }
  
  .timer-display {
    font-size: 24px;
  }
}
