/* Copyright © Crown Community. Tutti i diritti riservati. */

:root{
  --bg: #0b0c0d;
  --bg-elevated: #14100b;
  --bg-panel: #191309;
  --bg-panel-hover: #1f1810;
  --border: #3a2313;
  --border-strong: #5c2c0f;
  --accent: #c15200;
  --accent-light: #e2732b;
  --gold: #c99a52;
  --text: #ffe1cc;
  --text-heading: #ffd2b3;
  --muted: #ad9679;
  --muted-dim: #977f61;
  --warning: #ff8e2b;
  --danger: #e2543c;
  --imminent: #ff4b2b;
  --imminent-light: #ff8a5c;

  --font-display: 'Cinzel', serif;
  --font-body: 'Roboto', sans-serif;

  --radius: 3px;
}

*{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  position: relative;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

input,
textarea{
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}

img{
  -webkit-user-drag: none;
  user-drag: none;
}

.site-bg{
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("images/bg.png") center top / cover no-repeat, var(--bg);
}

.site-bg::after{
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6,5,4,0.5), rgba(6,5,4,0.82) 45%, #08090a 85%);
}

.visually-hidden{
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

a{ color: inherit; }

:focus-visible{
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
}

.site-header{
  background: linear-gradient(180deg, rgba(26,15,6,0.82), rgba(18,10,4,0.88));
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))){
  .site-header{
    background: linear-gradient(180deg, #1a0f06, #120a04);
  }
}

.header-inner{
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.brand{
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  line-height: 1.25;
  padding: 12px 0;
  flex: 1 1 0%;
}

.brand-logo{
  height: 36px;
  width: auto;
  object-fit: contain;
  display: block;
}

.brand-logo[data-broken]{
  display: none;
}

.brand-text{
  display: flex;
  flex-direction: column;
}

.brand-name{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.04em;
  color: var(--text-heading);
}

.brand-sub{
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.header-meta{
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 12px 0;
  flex: 1 1 0%;
}

.discord-link{
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.discord-link:hover{
  border-color: var(--accent);
  color: var(--text-heading);
}

.discord-icon{
  width: 15px;
  height: 15px;
  fill: currentColor;
  flex-shrink: 0;
}

.clock{
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  color: var(--text-heading);
  letter-spacing: 0.03em;
}

.restart-note{
  font-size: 11px;
  color: var(--muted-dim);
}

.restart-note time{
  color: var(--muted);
}

.ornament{
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
}

.ornament span{
  position: relative;
  width: 220px;
  max-width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong) 50%, transparent);
}

.ornament span::before{
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 6px; height: 6px;
  background: var(--accent);
  transform: translate(-50%, -50%) rotate(45deg);
}

.weekly-events{
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.ongoing-events{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 0 0 8px;
}

.ongoing-events[hidden]{
  display: none;
}

.ongoing-events-label{
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-dim);
  flex-shrink: 0;
}

.ongoing-chip{
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--accent-light);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 2px 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.ongoing-chip:hover{
  border-color: var(--accent);
  color: var(--gold);
}

.weekly-next-name,
.weekly-event-name{
  text-decoration: none;
}

.weekly-panel{
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.weekly-summary{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 18px;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}

.weekly-summary::-webkit-details-marker{
  display: none;
}

.weekly-summary:hover .weekly-next-name{
  color: var(--accent-light);
}

.weekly-next{
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.weekly-eyebrow{
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-dim);
  flex-shrink: 0;
}

.weekly-next-name{
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s ease;
}

.weekly-next-when{
  font-size: 11px;
  color: var(--muted-dim);
  white-space: nowrap;
}

.weekly-next-when::before{
  content: '·';
  display: inline-block;
  margin-right: 9px;
  color: var(--border-strong);
}

.weekly-summary-right{
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding-left: 14px;
  border-left: 1px solid var(--border);
}

.weekly-countdown{
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-size: 12.5px;
  color: var(--accent-light);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.weekly-chevron{
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--muted-dim);
  border-bottom: 1.5px solid var(--muted-dim);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.weekly-panel[open] .weekly-chevron{
  transform: rotate(-135deg);
}

.weekly-list{
  border-top: 1px solid var(--border);
  padding: 12px 16px 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px 10px;
}

.weekly-day-name{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 6px;
}

.weekly-day-events{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.weekly-day-events li{
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.weekly-event-name{
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--text);
}

.weekly-event-time{
  font-size: 10px;
  color: var(--muted-dim);
  font-variant-numeric: tabular-nums;
}

.hero{
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 24px 8px;
  text-align: center;
}

.hero h1{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 34px;
  letter-spacing: 0.03em;
  color: var(--text-heading);
  margin: 0 0 12px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}

.hero p{
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}

.controls{
  max-width: 1200px;
  margin: 24px auto 0;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.controls-left{
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.filters{
  display: flex;
  gap: 22px;
}

.toggle-btn{
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 6px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.toggle-btn:hover{
  border-color: var(--accent);
  color: var(--text-heading);
}

.toggle-btn[hidden]{
  display: none;
}

.toggle-btn[aria-pressed="true"]{
  border-color: var(--accent);
  color: var(--text-heading);
}

.toggle-btn-state{
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.5;
  padding: 1px 6px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--muted-dim);
}

.toggle-btn[aria-pressed="true"] .toggle-btn-state{
  border-color: var(--accent);
  color: var(--accent-light);
}

.notif-menu{
  position: relative;
}

.notif-menu-panel{
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 190px;
  padding: 6px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.notif-menu-panel[hidden]{
  display: none;
}

.notif-menu-item{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.03em;
  padding: 6px 8px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.notif-menu-item:hover{
  border-color: var(--accent);
  color: var(--text-heading);
}

.notif-menu-item[aria-pressed="true"]{
  color: var(--text-heading);
}

.notif-menu-item-state{
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 1px 6px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--muted-dim);
}

.notif-menu-item[aria-pressed="true"] .notif-menu-item-state{
  border-color: var(--accent);
  color: var(--accent-light);
}

.filter-btn{
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 6px 2px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.filter-btn:hover{
  color: var(--text-heading);
}

.filter-btn.is-active{
  color: var(--accent-light);
  border-bottom-color: var(--accent);
}

.search-field input{
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 9px 12px;
  width: 220px;
  transition: border-color 0.15s ease;
}

.search-field input::placeholder{
  color: var(--muted-dim);
}

.search-field input:focus{
  border-color: var(--accent);
  outline: none;
}

.tracker-main{
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px 56px;
}

.grid-status{
  font-size: 12px;
  color: var(--muted-dim);
  margin: 0 0 14px;
}

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

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

.empty-state h2{
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text-heading);
  margin: 0 0 8px;
}

.empty-state p{
  margin: 0;
  font-size: 13px;
}

.tracker-card{
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.tracker-card:hover{
  background: var(--bg-panel-hover);
  border-color: var(--border-strong);
}

.tracker-card.is-available{
  border-color: var(--gold);
}

.card-top{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-category{
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 2px;
}

.card-category.category-boss{ color: var(--accent-light); }
.card-category.category-metin{ color: #b98fce; border-bottom-color: #5a3a6e; }

.card-badge{
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 2px 7px;
  visibility: hidden;
}

.tracker-card.is-available .card-badge{
  visibility: visible;
}

.card-top-right{
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-favorite-btn{
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 17px;
  line-height: 1;
  color: var(--muted-dim);
  transition: color 0.15s ease;
}

.card-favorite-btn:hover{
  color: var(--gold);
}

.card-favorite-btn.is-favorite{
  color: var(--gold);
}

.card-media{
  width: 100%;
  height: 110px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-elevated);
}

.card-media img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-media a{
  display: block;
  width: 100%;
  height: 100%;
}

.card-media.is-placeholder,
.card-media.is-placeholder a{
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-media.is-placeholder span{
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--muted-dim);
}

.card-name{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.25;
  color: var(--text-heading);
  margin: 0;
  height: 2.5em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-map{
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  height: 2.8em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-respawn-rate{
  font-size: 11px;
  color: var(--muted-dim);
}

.card-notes{
  font-size: 11.5px;
  color: var(--muted);
  font-style: italic;
}

.card-countdown{
  font-variant-numeric: tabular-nums;
  font-size: 25px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-heading);
  text-align: center;
  padding: 6px 0 2px;
}

.card-countdown.urgency-warning{ color: var(--warning); }
.card-countdown.urgency-critical{ color: var(--danger); }

.card-progress{
  height: 3px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
}

.card-progress-fill{
  height: 100%;
  background: var(--accent);
  transition: width 1s linear;
}

.card-progress-fill.urgency-warning{ background: var(--warning); }
.card-progress-fill.urgency-critical{ background: var(--danger); }

.card-spawns{
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--muted);
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.card-spawns div{
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-spawns dt{
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
  color: var(--muted-dim);
}

.card-spawns dd{
  margin: 0;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.card-hide-btn{
  align-self: flex-end;
  background: none;
  border: none;
  color: var(--muted-dim);
  font-family: var(--font-body);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 2px 0;
}

.card-hide-btn:hover{
  color: var(--accent-light);
}

@keyframes card-flash{
  0%, 100%{ box-shadow: none; }
  50%{ box-shadow: 0 0 0 2px rgba(201, 154, 82, 0.6); }
}

.tracker-card.is-flashing{
  animation: card-flash 0.9s ease-in-out;
}

@keyframes card-imminent-pulse{
  0%, 100%{
    transform: scale(1);
    border-color: var(--imminent);
    box-shadow: 0 0 0 1px var(--imminent), 0 0 8px 1px rgba(255, 75, 43, 0.24);
    filter: brightness(1);
  }
  50%{
    transform: scale(1.02);
    border-color: var(--imminent-light);
    box-shadow: 0 0 0 2px var(--imminent-light), 0 0 22px 5px rgba(255, 75, 43, 0.68);
    filter: brightness(1.09);
  }
}

.tracker-card.is-imminent,
.weekly-panel.is-imminent{
  animation: card-imminent-pulse 1s ease-in-out infinite;
  will-change: transform, box-shadow;
}

.site-footer{
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  text-align: center;
}

.site-footer p{
  margin: 0 auto;
  max-width: 640px;
  font-size: 11px;
  color: var(--muted-dim);
  line-height: 1.5;
  opacity: 0.85;
}

.site-footer p + p{
  margin-top: 6px;
}

.disclaimer{
  font-size: 10px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
  opacity: 0.85;
}

@media (max-width: 640px){
  .header-inner{ flex-direction: column; align-items: flex-start; gap: 4px; }
  .brand,
  .header-meta{ flex: none; }
  .header-meta{ align-items: flex-start; }
  .discord-link{ padding: 6px 8px; }
  .discord-link-label{ display: none; }
  .hero h1{ font-size: 27px; }
  .weekly-summary{ padding: 8px 12px; gap: 10px; }
  .weekly-next{ gap: 6px; }
  .weekly-eyebrow{ display: none; }
  .weekly-next-name{ font-size: 13px; }
  .weekly-next-when{ font-size: 10.5px; }
  .weekly-summary-right{ border-left: none; padding-left: 0; }
  .weekly-countdown{ font-size: 12px; }
  .weekly-list{ grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); padding: 10px 12px 12px; gap: 10px 8px; }
  .controls{ flex-direction: column; align-items: stretch; }
  .search-field input{ width: 100%; }
  .tracker-grid{ grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  .card-progress-fill{ transition: none; }
  .tracker-card.is-flashing{
    animation: none;
    border-color: var(--gold);
  }
  .tracker-card.is-imminent{
    animation: none;
    border-color: var(--imminent);
  }
  .weekly-panel.is-imminent{
    animation: none;
    border-color: var(--imminent);
  }
}

body.compact-mode .tracker-grid{
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

body.compact-mode .tracker-card{
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  padding: 8px 14px;
}

body.compact-mode .card-media{
  display: none;
}

body.compact-mode .card-top{
  order: 1;
  flex: 0 0 auto;
  align-items: center;
}

body.compact-mode .card-name{
  order: 2;
  height: auto;
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  white-space: nowrap;
  font-size: 14px;
  flex: 1 1 140px;
  min-width: 100px;
}

body.compact-mode .card-map{
  order: 3;
  height: auto;
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  white-space: nowrap;
  font-size: 11px;
  flex: 1 1 140px;
  min-width: 100px;
}

body.compact-mode .card-respawn-rate,
body.compact-mode .card-notes{
  display: none;
}

body.compact-mode .card-countdown{
  order: 4;
  font-size: 16px;
  padding: 0;
  flex: 0 0 auto;
  min-width: 92px;
}

body.compact-mode .card-progress{
  order: 5;
  flex: 0 0 80px;
}

body.compact-mode .card-spawns{
  order: 6;
  border-top: none;
  padding-top: 0;
  flex: 0 0 auto;
}

body.compact-mode .card-spawns > div:last-child{
  display: none;
}

body.compact-mode .card-hide-btn{
  order: 7;
  align-self: center;
  margin-left: auto;
}

@media (max-width: 640px){
  body.compact-mode .tracker-grid{
    gap: 3px;
  }

  body.compact-mode .tracker-card{
    padding: 5px 10px;
    gap: 3px 10px;
  }

  body.compact-mode .card-name{
    font-size: 12.5px;
    flex-basis: 90px;
    min-width: 80px;
  }

  body.compact-mode .card-map{
    font-size: 10px;
    flex-basis: 80px;
    min-width: 70px;
  }

  body.compact-mode .card-countdown{
    font-size: 13.5px;
    min-width: 74px;
  }

  body.compact-mode .card-progress{
    flex-basis: 50px;
  }

  body.compact-mode .card-spawns dt{
    display: none;
  }

  body.compact-mode .card-favorite-btn{
    font-size: 15px;
  }

  body.compact-mode .card-hide-btn{
    font-size: 9.5px;
  }
}
