:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", sans-serif;
  background-color: #f5f6fb;
  color: #1f2933;
  --accent: #4f46e5;
  --accent-soft: #6366f1;
  --border: #e2e8f0;
  --border-strong: #cbd5f5;
  --success: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --muted: #64748b;
  --panel-bg: #ffffff;
  --cell-size: 48px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  display: flex;
  flex-direction: column;
}

.app-header {
  padding: 2.25rem 5vw 1.5rem;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.app-header h1 {
  margin: 0;
  font-size: 2.1rem;
  letter-spacing: 0.03em;
}

.tagline {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.layout {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  padding: 1.5rem 5vw 3rem;
  flex: 1;
}

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.08);
}

.panel h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  letter-spacing: 0.03em;
}

.panel h3 {
  margin: 1.25rem 0 0.6rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}

.inline-form {
  display: flex;
  gap: 0.6rem;
}

.inline-form input,
.stacked-form input,
.stacked-form select {
  flex: 1;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f9fafb;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.inline-form input:focus,
.stacked-form input:focus,
.stacked-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

button {
  border: none;
  padding: 0.68rem 1.2rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #fff;
  letter-spacing: 0.05em;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

button:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px rgba(79, 70, 229, 0.3);
}

button.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
  box-shadow: none;
}

.connection-status {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.connection-status.online {
  color: var(--success);
}

.connection-status.offline {
  color: var(--danger);
}

.list {
  list-style: none;
  padding: 0;
  margin: 0.8rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.list li {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.list.compact li {
  padding: 0.55rem 0.65rem;
  font-size: 0.88rem;
}

.list li.empty {
  justify-content: center;
  color: var(--muted);
  font-style: italic;
}

.requests .request-actions,
.invite-actions {
  display: flex;
  gap: 0.5rem;
}

.requests li.incoming-request {
  align-items: flex-start;
}

.pill {
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--border-strong);
  background: rgba(99, 102, 241, 0.08);
  color: var(--accent);
}

.pill-okay {
  color: var(--success);
  border-color: rgba(22, 163, 74, 0.25);
  background: rgba(22, 163, 74, 0.08);
}

.pill-warn {
  color: var(--warn);
  border-color: rgba(217, 119, 6, 0.25);
  background: rgba(217, 119, 6, 0.08);
}

.pill-pending {
  color: var(--muted);
  border-color: var(--border);
  background: rgba(148, 163, 184, 0.15);
}

.stacked-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.stacked-form label {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.92rem;
}

.hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 1rem;
  line-height: 1.5;
}

.status {
  min-height: 3.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 14px;
  margin-bottom: 1rem;
  padding: 0.65rem;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 6px;
  justify-content: center;
}

.cell {
  width: var(--cell-size);
  height: var(--cell-size);
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
}

.cell.available:hover {
  cursor: pointer;
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 10px 16px rgba(79, 70, 229, 0.18);
}

.cell.available::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.12);
}

.cell.you {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(37, 99, 235, 0.35));
  border-color: rgba(37, 99, 235, 0.45);
}

.cell.friend {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.25), rgba(236, 72, 153, 0.35));
  border-color: rgba(236, 72, 153, 0.4);
}

.cell.banned {
  border-style: dashed;
  border-color: rgba(220, 38, 38, 0.6);
  background: repeating-linear-gradient(45deg, rgba(220, 38, 38, 0.18), rgba(220, 38, 38, 0.18) 8px, rgba(255, 255, 255, 0.6) 8px, rgba(255, 255, 255, 0.6) 16px);
}

.cell.banned::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 6px;
  border: 2px solid rgba(220, 38, 38, 0.4);
}


.cell.banned.available {
  cursor: pointer;
  border-style: solid;
  border-color: rgba(220, 38, 38, 0.75);
  box-shadow: 0 10px 18px rgba(220, 38, 38, 0.15);
}

.cell.banned.available:hover {
  box-shadow: 0 14px 24px rgba(220, 38, 38, 0.25);
  transform: translateY(-1px);
}

.cell.banned.available::after {
  inset: 8px;
  border-radius: 8px;
  border: 2px solid rgba(220, 38, 38, 0.35);
  background: rgba(248, 113, 113, 0.15);
}

@media (max-width: 640px) {
  :root {
    --cell-size: 40px;
  }

  .layout {
    grid-template-columns: 1fr;
  }
}

.invite-item {
  align-items: flex-start;
}

.invite-copy {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.invite-meta {
  color: var(--muted);
  font-size: 0.78rem;
}
