:root{
  --gold:#f5b93f;
  --gold-strong:#ffd447;
  --green:#0c7a38;
  --green-deep:#063d1c;
  --dark:#05100b;
  --panel:rgba(0,0,0,.62);
  --panel-soft:rgba(8,18,12,.72);
  --line:rgba(245,185,63,.38);
  --line-strong:rgba(255,215,68,.45);
  --text:#fff;
  --muted:#d5d9df;
  --shadow:0 18px 45px rgba(0,0,0,.5);
  --radius:20px;
  --max-content:1240px;
}

*{box-sizing:border-box}

html{scroll-behavior:smooth}

body{
  margin:0;
  min-height:100vh;
  color:var(--text);
  font-family:Arial,Helvetica,sans-serif;
  background:
    linear-gradient(rgba(0,0,0,.38), rgba(0,0,0,.64)),
    url('/assets/fundo.png') center calc(50% - 60px)/cover no-repeat fixed;
  background-color:#000;
}

a{color:inherit}
button,input,select,textarea{font:inherit}
img{max-width:100%;display:block}

.screen{
  width:min(var(--max-content), calc(100% - 32px));
  margin:auto;
  padding:24px 0 32px;
}

.phone-app,
.app-frame{
  width:min(430px,100%);
  margin:auto;
}

.phone-app{
  min-height:100vh;
  padding:22px 18px 28px;
  background:linear-gradient(rgba(0,60,20,.35),rgba(0,0,0,.35));
  border-left:1px solid rgba(255,255,255,.1);
  border-right:1px solid rgba(255,255,255,.1);
}

.logo{
  text-align:center;
  margin:18px 0 22px;
}

.logo h1{
  margin:0;
  font-size:48px;
  line-height:.9;
  text-transform:uppercase;
  color:var(--gold-strong);
  text-shadow:0 8px 18px #000;
}

.logo span{display:block;font-size:28px;color:#fff}
.logo .year{font-size:58px;color:#fff}

.grid2{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.btn-tile,
.primary,
.app-tile,
.rules-btn{
  position:relative;
  overflow:hidden;
}

.btn-tile{
  border:1px solid rgba(255,255,255,.22);
  border-radius:18px;
  padding:18px 12px;
  background:linear-gradient(135deg,#f5b93f,#b98112);
  color:#111;
  font-weight:900;
  text-align:center;
  box-shadow:0 10px 25px rgba(0,0,0,.35);
  cursor:pointer;
}

.btn-tile.green{
  background:linear-gradient(135deg,#0f9d4a,#075c2b);
  color:#fff;
}

.scorebar,
.card,
.metric,
.points-card,
.game-card,
.rank-line,
.prize-line{
  background:var(--panel) !important;
  border:1px solid var(--line-strong) !important;
  border-radius:var(--radius);
  padding:18px;
  box-shadow:var(--shadow), 0 0 18px rgba(255,215,68,.1) !important;
  backdrop-filter:blur(10px) !important;
}

.scorebar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}

.big{
  font-size:42px;
  font-weight:900;
  color:#fff;
}

.form{
  display:grid;
  gap:12px;
}

.form input,
.form select,
input,
select{
  width:100%;
  min-height:48px;
  padding:13px 14px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(0,0,0,.45);
  color:#fff;
  outline:none;
}

.form input:focus,
.form select:focus,
input:focus,
select:focus{
  border-color:rgba(255,219,63,.7);
  box-shadow:0 0 0 3px rgba(255,219,63,.12);
}

.primary,
.ghost,
.danger,
button{
  min-height:46px;
  padding:12px 16px;
  border-radius:14px;
  border:0;
  font-weight:900;
  cursor:pointer;
}

.primary{
  background:linear-gradient(135deg,#f5b93f,#d99517);
  color:#111;
}

.ghost{
  background:rgba(255,255,255,.08);
  color:#fff;
  border:1px solid rgba(255,255,255,.18);
}

.danger{
  background:#c94545;
  color:#fff;
}

.table{
  width:100%;
  border-collapse:collapse;
}

.table th,
.table td{
  padding:12px 10px;
  border-bottom:1px solid rgba(255,255,255,.12);
  text-align:left;
  vertical-align:middle;
}

.table th{color:var(--gold-strong)}

.teamline{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:900;
  flex-wrap:wrap;
}

.crest{
  width:38px;
  height:38px;
  object-fit:contain;
  filter:drop-shadow(0 0 8px rgba(245,185,63,.35));
}

.admin-layout{
  display:grid;
  grid-template-columns:280px minmax(0,1fr);
  min-height:100vh;
}

.sidebar{
  background:rgba(0,0,0,.8);
  border-right:1px solid var(--line);
  padding:24px 18px;
  position:sticky;
  top:0;
  height:100vh;
  overflow:auto;
}

.sidebar h2{
  margin:0 0 18px;
  color:var(--gold-strong);
}

.sidebar button{
  display:block;
  width:100%;
  margin:8px 0;
  padding:13px 14px;
  border-radius:12px;
  border:1px solid transparent;
  background:transparent;
  color:#fff;
  text-align:left;
  cursor:pointer;
  min-height:44px;
}

.sidebar button.active,
.sidebar button:hover{
  background:rgba(245,185,63,.18);
  border-color:rgba(245,185,63,.35);
}

.main{
  width:min(100%, 1200px);
  padding:24px;
}

.main h1{
  margin:0 0 18px;
  font-size:clamp(30px,3vw,42px);
  color:#fff;
}

.metrics{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
}

.metric strong{
  display:block;
  margin-top:8px;
  font-size:28px;
}

.hidden{display:none}

.row-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.bottom-nav,
.bottom-app{
  position:sticky;
  bottom:10px;
  margin-top:18px;
  background:rgba(0,60,22,.82) !important;
  border:1px solid rgba(255,215,68,.28) !important;
  border-radius:22px;
  display:grid;
  grid-template-columns:repeat(4,1fr);
  overflow:hidden;
  backdrop-filter:blur(12px);
  box-shadow:0 -8px 26px rgba(0,0,0,.3);
}

.bottom-nav button,
.bottom-app button{
  padding:12px 6px;
  background:transparent;
  color:#fff;
  border:0;
  font-weight:800;
  cursor:pointer;
}

.bottom-nav button.active,
.bottom-app button.active{
  background:rgba(245,185,63,.25);
  color:var(--gold-strong);
}

button::after,
.app-tile::after,
.rules-btn::after,
.primary::after{
  content:"";
  position:absolute;
  top:-60%;
  left:-80%;
  width:55%;
  height:220%;
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.42), transparent);
  transform:rotate(25deg);
  animation:brilhoBotao 3.2s infinite;
  pointer-events:none;
}

@keyframes brilhoBotao{
  0%{left:-90%;opacity:0}
  18%{opacity:.9}
  35%{left:130%;opacity:0}
  100%{left:130%;opacity:0}
}

.logo .title,
.logo-title{
  animation:glowLogo 2.4s ease-in-out infinite alternate;
}

@keyframes glowLogo{
  from{text-shadow:0 4px 0 #986700,0 9px 16px #000,0 0 6px rgba(255,218,70,.25)}
  to{text-shadow:0 4px 0 #986700,0 9px 16px #000,0 0 20px rgba(255,218,70,.75)}
}

.app-tile,
.btn-tile{
  transition:transform .18s ease, filter .18s ease, box-shadow .18s ease;
}

.app-tile:hover,
.btn-tile:hover{
  transform:translateY(-2px) scale(1.01);
  filter:brightness(1.08);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.25),
    0 12px 28px rgba(0,0,0,.5),
    0 0 18px rgba(255,215,68,.18);
}

.app-tile:active,
.btn-tile:active,
.rules-btn:active,
.primary:active{transform:scale(.97)}

.phone-shell,
.phone{
  box-shadow:
    0 30px 90px rgba(0,0,0,.78),
    0 0 32px rgba(255,215,68,.2),
    inset 0 0 0 2px rgba(255,255,255,.1) !important;
}

.table-wrap{
  width:100%;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}

@media (max-width:1100px){
  .metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media (max-width:900px){
  body{
    background-size:cover !important;
    background-attachment:scroll !important;
  }

  .admin-layout{
    grid-template-columns:1fr;
  }

  .sidebar{
    position:sticky;
    top:0;
    height:auto;
    z-index:20;
    padding:14px 12px;
    border-right:0;
    border-bottom:1px solid var(--line);
  }

  .sidebar h2{
    margin-bottom:12px;
    font-size:22px;
  }

  .sidebar button{
    display:inline-flex;
    width:auto;
    min-width:max-content;
    margin:4px 6px 4px 0;
    text-align:center;
  }

  .main{
    width:100%;
    padding:16px 12px 28px;
  }
}

@media (max-width:700px){
  .screen{width:min(100%, calc(100% - 20px));padding:14px 0 24px}
  .phone-app,.app-frame{width:100%}
  .phone-app{
    max-width:none;
    padding:16px 14px 24px;
    border-left:0;
    border-right:0;
  }

  .grid2{grid-template-columns:1fr}
  .metrics{grid-template-columns:1fr}

  .scorebar{
    flex-direction:column;
    align-items:flex-start;
  }

  .big{font-size:34px}

  .table{
    min-width:640px;
  }

  .bottom-nav,
  .bottom-app{
    grid-template-columns:repeat(4,minmax(0,1fr));
    border-radius:18px;
  }

  .bottom-nav button,
  .bottom-app button{
    font-size:12px;
    padding:10px 4px;
  }
}

@media (max-width:520px){
  .main h1{font-size:28px}
  .card,
  .scorebar,
  .metric,
  .points-card,
  .game-card,
  .rank-line,
  .prize-line{
    padding:14px;
    border-radius:16px;
  }

  .sidebar{
    white-space:nowrap;
    overflow:auto;
  }

  .sidebar button{
    padding:10px 12px;
    font-size:14px;
  }

  .form input,
  .form select,
  input,
  select{
    min-height:46px;
    padding:12px;
  }
}
