:root{
  --text:#f3f4f6;
  --muted:rgba(255,255,255,.58);
  --accent:#33b5ff;
  --accent-2:#0a84ff;
}

*{
  box-sizing:border-box;
}

html,
body{
  min-height:100%;
  margin:0;
  font-family:Arial, Helvetica, sans-serif;
  color:var(--text);
  overflow-x:hidden;
}

body{
  position:relative;
  display:flex;
  justify-content:center;
  align-items:flex-start;
  padding:10px 8px;
  min-height:100vh;
  background:
    linear-gradient(rgba(0,8,18,.18),rgba(0,8,18,.32)),
    url("images/sunset_background_for_github.jpg") center center / cover no-repeat fixed,
    #02070f;
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:0;
  background:
    radial-gradient(circle at 50% 0%, rgba(51,181,255,.06), transparent 24%),
    radial-gradient(circle at 80% 25%, rgba(10,132,255,.04), transparent 18%),
    radial-gradient(circle at 20% 20%, rgba(120,210,255,.03), transparent 24%),
    linear-gradient(to bottom, rgba(10,132,255,.01), transparent 25%);
}

.page-wrap{
  position:relative;
  z-index:1;
  width:100%;
  max-width:430px;
  display:flex;
  justify-content:center;
}

.app-shell{
  width:100%;
  max-width:370px;
  min-height:760px;
  padding:4px;
  border-radius:26px;
  position:relative;
  background:linear-gradient(180deg, rgba(58,186,255,.96), rgba(0,92,184,.86));
  box-shadow:
    0 0 0 1px rgba(58,186,255,.96),
    0 0 10px rgba(51,181,255,.30),
    0 0 20px rgba(10,132,255,.14),
    0 14px 28px rgba(0,0,0,.28);
  overflow:visible;
  animation:pageEnter .28s ease both;
}

.app-shell::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:26px;
  pointer-events:none;
  box-shadow:
    inset 0 0 0 1px rgba(164,230,255,.92),
    0 0 8px rgba(51,181,255,.14);
}

.app-shell::after{
  content:"";
  position:absolute;
  inset:4px;
  border-radius:22px;
  background:linear-gradient(180deg, rgba(5,14,30,.92), rgba(1,7,18,.97));
  border:1px solid rgba(51,181,255,.14);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 8px 20px rgba(0,0,0,.20);
  z-index:0;
}

@keyframes pageEnter{
  from{
    opacity:0;
    transform:translateY(8px) scale(.985);
  }

  to{
    opacity:1;
    transform:translateY(0) scale(1);
  }
}

.page-back,
.page-gallery{
  position:absolute;
  top:10px;
  z-index:60;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:32px;
  padding:0 10px;
  border-radius:12px;
  text-decoration:none;
  color:#ffffff;
  font-size:12px;
  font-weight:700;
  letter-spacing:.2px;
  border:1px solid rgba(51,181,255,.30);
  background:linear-gradient(180deg, rgba(2,11,23,.96), rgba(3,18,38,.90));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 4px 10px rgba(0,0,0,.16),
    0 0 8px rgba(51,181,255,.08);
  transition:
    transform .22s ease,
    box-shadow .22s ease,
    border-color .22s ease,
    background .22s ease;
}

.page-back{
  left:10px;
  min-width:90px;
}

.page-gallery{
  right:10px;
  min-width:84px;
}

.page-back:hover,
.page-gallery:hover{
  transform:translateY(-2px);
  border-color:rgba(51,181,255,.55);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 8px 18px rgba(0,0,0,.18),
    0 0 12px rgba(51,181,255,.16);
}

.page-back:active,
.page-gallery:active{
  transform:translateY(0) scale(.98);
}

.page-header,
.filter-card,
.leaderboard-card{
  position:relative;
  z-index:1;
}

.page-header{
  padding-top:42px;
}

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

.logo{
  width:min(100%,180px);
  display:block;
  border-radius:22px;
  filter:
    drop-shadow(0 0 8px rgba(51,181,255,.30))
    drop-shadow(0 0 18px rgba(51,181,255,.20))
    drop-shadow(0 0 34px rgba(10,132,255,.16));
  transition:
    transform .28s ease,
    filter .28s ease;
}

.logo:hover{
  transform:scale(1.025);
  filter:
    drop-shadow(0 0 10px rgba(51,181,255,.36))
    drop-shadow(0 0 22px rgba(51,181,255,.24))
    drop-shadow(0 0 38px rgba(10,132,255,.18));
}

.filter-card{
  position:relative;
  z-index:20;
  width:calc(100% - 16px);
  margin:0 8px 10px;
  padding:0;
  background:transparent;
  border:0;
  box-shadow:none;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}

.filter-card::before{
  display:none;
}

.custom-dropdown{
  position:relative;
  z-index:50;
  width:100%;
  margin-bottom:2px;
}

.dropdown-button{
  width:100%;
  min-height:66px;
  padding:11px 12px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.06);
  background:linear-gradient(90deg, rgba(2,11,23,.95), rgba(3,18,38,.88));
  color:var(--text);
  display:grid;
  grid-template-columns:1fr 20px;
  align-items:center;
  gap:10px;
  font-size:16px;
  cursor:pointer;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.03),
    0 6px 14px rgba(0,0,0,.14);
  transition:
    transform .22s ease,
    box-shadow .22s ease,
    border-color .22s ease,
    background .22s ease;
}

.dropdown-button:hover{
  border-color:rgba(51,181,255,.20);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.03),
    0 8px 18px rgba(0,0,0,.16),
    0 0 12px rgba(51,181,255,.08);
  transform:translateY(-2px);
}

.dropdown-button:active{
  transform:translateY(0) scale(.99);
}

.dropdown-left{
  display:grid;
  grid-template-columns:26px 1fr;
  align-items:start;
  gap:10px;
  min-width:0;
  text-align:left;
}

.dropdown-icon{
  display:flex;
  align-items:flex-start;
  justify-content:center;
  color:var(--accent);
  padding-top:2px;
}

.dropdown-icon svg{
  width:18px;
  height:18px;
  stroke:currentColor;
  fill:none;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.dropdown-body{
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-height:40px;
}

.dropdown-field-label{
  font-size:11px;
  font-weight:700;
  color:rgba(255,255,255,.92);
  margin-bottom:4px;
  line-height:1;
}

#selectedValue{
  font-size:16px;
  line-height:1.2;
  font-weight:500;
  color:var(--text);
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  display:flex;
  align-items:center;
  min-height:20px;
}

.dropdown-arrow{
  display:flex;
  align-items:flex-start;
  justify-content:center;
  color:var(--accent);
  padding-top:2px;
  transition:transform .24s ease;
}

.dropdown-arrow svg{
  width:18px;
  height:18px;
  stroke:currentColor;
  fill:none;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.dropdown-button.open .dropdown-arrow{
  transform:rotate(180deg);
}

.dropdown-menu{
  display:none;
  position:absolute;
  left:0;
  right:0;
  top:calc(100% + 6px);
  background:rgba(6,15,28,.98);
  border:1px solid rgba(51,181,255,.24);
  border-radius:14px;
  z-index:9999;
  box-shadow:
    0 0 14px rgba(51,181,255,.12),
    0 10px 24px rgba(0,0,0,.24);
  max-height:min(240px, 50vh);
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  scrollbar-width:thin;
  scrollbar-color:rgba(51,181,255,.45) rgba(6,15,28,.98);
}

.dropdown-menu::-webkit-scrollbar{
  width:8px;
}

.dropdown-menu::-webkit-scrollbar-track{
  background:rgba(6,15,28,.98);
  border-radius:999px;
}

.dropdown-menu::-webkit-scrollbar-thumb{
  background:rgba(51,181,255,.45);
  border-radius:999px;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover{
  background:rgba(51,181,255,.65);
}

.dropdown-menu.active{
  display:block;
  animation:dropdownIn .2s ease both;
}

@keyframes dropdownIn{
  from{
    opacity:0;
    transform:translateY(-6px) scale(.985);
  }

  to{
    opacity:1;
    transform:translateY(0) scale(1);
  }
}

.dropdown-item{
  width:100%;
  padding:10px 12px;
  font-size:14px;
  color:#f3f4f6;
  border-top:1px solid rgba(255,255,255,.05);
  text-align:center;
  cursor:pointer;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  transition:
    background .18s ease,
    color .18s ease,
    box-shadow .18s ease;
  -webkit-tap-highlight-color:transparent;
}

.dropdown-item:first-child{
  border-top:0;
}

.dropdown-item:hover{
  background:rgba(51,181,255,.12);
  box-shadow:inset 0 0 12px rgba(51,181,255,.08);
}

.dropdown-item.active{
  background:rgba(51,181,255,.16);
  color:#ffffff;
  box-shadow:inset 0 0 14px rgba(51,181,255,.10);
}

.card{
  width:calc(100% - 16px);
  margin-left:8px;
  margin-right:8px;
  background:linear-gradient(180deg, rgba(5,14,30,.92), rgba(1,7,18,.97));
  border:1px solid rgba(51,181,255,.14);
  border-radius:22px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 8px 20px rgba(0,0,0,.20);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  position:relative;
  overflow:visible;
  transition:
    transform .24s ease,
    box-shadow .24s ease,
    border-color .24s ease;
}

.card:hover{
  transform:translateY(-2px);
  border-color:rgba(51,181,255,.24);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 12px 26px rgba(0,0,0,.25),
    0 0 16px rgba(51,181,255,.08);
}

.card::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  border-radius:22px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.04), transparent 18%, transparent 82%, rgba(51,181,255,.03));
}

.leaderboard-card{
  padding:10px 10px 12px;
  margin-bottom:10px;
}

.leaderboard-header{
  position:relative;
  z-index:1;
  margin-bottom:8px;
}

.leaderboard-header h2{
  margin:0;
  color:#ffffff;
  font-size:18px;
  line-height:1.2;
  font-weight:700;
  text-align:center;
}

.table-wrap{
  position:relative;
  z-index:1;
  width:100%;
  overflow:hidden;
  border-radius:16px;
  background:linear-gradient(90deg, rgba(2,11,23,.95), rgba(3,18,38,.88));
  border:1px solid rgba(255,255,255,.06);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.03),
    0 6px 14px rgba(0,0,0,.14);
}

table{
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;
}

thead th{
  padding:10px 4px 8px;
  font-size:12px;
  font-weight:700;
  color:rgba(255,255,255,.92);
  text-align:center;
  border-bottom:1px solid rgba(255,255,255,.06);
}

tbody td{
  padding:10px 4px;
  font-size:13px;
  color:var(--text);
  text-align:center;
  border-top:1px solid rgba(255,255,255,.05);
  line-height:1.25;
  transition:
    background .18s ease,
    color .18s ease;
}

tbody tr:first-child td{
  border-top:0;
}

tbody tr:nth-child(odd){
  background:rgba(255,255,255,.015);
}

.empty-row td{
  padding:14px 8px;
  color:var(--muted);
}

.species-table th:nth-child(1),
.species-table td:nth-child(1){
  width:10%;
}

.species-table th:nth-child(2),
.species-table td:nth-child(2){
  width:28%;
  text-align:left;
  padding-left:6px;
  word-break:break-word;
  overflow-wrap:anywhere;
}

.species-table th:nth-child(3),
.species-table td:nth-child(3){
  width:18%;
}

.species-table th:nth-child(4),
.species-table td:nth-child(4){
  width:26%;
}

.species-table th:nth-child(5),
.species-table td:nth-child(5){
  width:18%;
}

.total-table th:nth-child(1),
.total-table td:nth-child(1){
  width:12%;
}

.total-table th:nth-child(2),
.total-table td:nth-child(2){
  width:44%;
  text-align:left;
  padding-left:6px;
  word-break:break-word;
  overflow-wrap:anywhere;
}

.total-table th:nth-child(3),
.total-table td:nth-child(3){
  width:22%;
}

.total-table th:nth-child(4),
.total-table td:nth-child(4){
  width:22%;
}

.clickable-row{
  cursor:pointer;
  transition:background .18s ease;
}

.clickable-row:hover td{
  background:rgba(51,181,255,.12);
}

#imageModal{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  z-index:99999;
  background:rgba(0,0,0,.82);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  padding:18px;
}

#imageModal.show{
  display:flex;
  animation:modalFade .18s ease both;
}

@keyframes modalFade{
  from{
    opacity:0;
  }

  to{
    opacity:1;
  }
}

.image-modal-backdrop{
  position:relative;
  width:100%;
  max-width:720px;
  animation:modalImageIn .22s ease both;
}

@keyframes modalImageIn{
  from{
    opacity:0;
    transform:scale(.965);
  }

  to{
    opacity:1;
    transform:scale(1);
  }
}

.image-modal-close{
  position:absolute;
  top:-44px;
  right:0;
  width:36px;
  height:36px;
  border-radius:999px;
  border:1px solid rgba(51,181,255,.34);
  background:rgba(2,11,23,.96);
  color:#fff;
  font-size:24px;
  cursor:pointer;
  transition:
    transform .2s ease,
    border-color .2s ease,
    box-shadow .2s ease;
}

.image-modal-close:hover{
  transform:scale(1.06);
  border-color:rgba(51,181,255,.62);
  box-shadow:0 0 14px rgba(51,181,255,.18);
}

.image-modal-img{
  width:100%;
  max-height:80vh;
  object-fit:contain;
  border-radius:20px;
  box-shadow:
    0 0 0 1px rgba(51,181,255,.25),
    0 0 30px rgba(51,181,255,.18),
    0 18px 50px rgba(0,0,0,.45);
}

@media (max-width:420px){
  body{
    padding:10px 8px;
  }

  .page-wrap{
    max-width:100%;
  }

  .app-shell{
    max-width:100%;
    width:100%;
    min-height:760px;
  }

  .logo{
    width:min(100%,182px);
  }

  .dropdown-button{
    min-height:66px;
    padding:11px 12px;
  }

  .page-back{
    top:10px;
    left:10px;
    min-width:84px;
    height:30px;
    font-size:11px;
    padding:0 8px;
  }

  .page-gallery{
    top:10px;
    right:10px;
    min-width:72px;
    height:30px;
    font-size:11px;
    padding:0 8px;
  }

  thead th{
    font-size:11px;
  }

  tbody td{
    font-size:12px;
  }
}
/* Endast webbläsare/desktop */
@media (min-width:768px){
  .page-wrap{
    max-width:520px;
  }

  .app-shell{
    max-width:450px;
    margin:0 auto;
  }
}
@media (prefers-reduced-motion: reduce){
  *,
  *::before,
  *::after{
    animation-duration:.01ms !important;
    animation-iteration-count:1 !important;
    scroll-behavior:auto !important;
    transition-duration:.01ms !important;
  }
}
