body {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='84' viewBox='0 0 84 84'%3E%3Cpath d='M2 2h28v10c0 6 5 10 11 10s11-4 11-10V2h30v29H72c-6 0-10 5-10 11s4 11 10 11h10v29H52V72c0-6-5-10-11-10s-11 4-11 10v10H2V53h10c6 0 10-5 10-11s-4-11-10-11H2Z' fill='none' stroke='%23ffffff' stroke-opacity='.10' stroke-width='2'/%3E%3C/svg%3E"),
    radial-gradient(circle at 80% 10%, rgba(40,182,230,.46), transparent 32rem),
    linear-gradient(125deg, #102b67, #0b699d 58%, #071a43);
  background-size: 84px 84px, auto, auto;
}

.admin-body {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='84' viewBox='0 0 84 84'%3E%3Cpath d='M2 2h28v10c0 6 5 10 11 10s11-4 11-10V2h30v29H72c-6 0-10 5-10 11s4 11 10 11h10v29H52V72c0-6-5-10-11-10s-11 4-11 10v10H2V53h10c6 0 10-5 10-11s-4-11-10-11H2Z' fill='none' stroke='%23174a88' stroke-opacity='.065' stroke-width='2'/%3E%3C/svg%3E"),
    linear-gradient(135deg, #f2f7fc, #e6eff8);
  background-size: 84px 84px, auto;
}

.compact { gap: .55rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.actions form { margin: 0; }
.icon-button {
  width: 38px; height: 38px; padding: 0; border-radius: 50%;
  color: white; background: linear-gradient(#326eb2,#142f68);
  border: 2px solid var(--gold); cursor: pointer; font-size: 1.25rem; font-weight: 900;
}
.prize-row { display: grid; grid-template-columns: minmax(0,1fr) 190px 42px; gap: .65rem; align-items: end; }
.money-input { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .35rem; }
.money-input input { min-width: 0; }
.week-summary, .auto-assignment {
  display: grid; align-content: center; gap: .15rem; padding: .75rem 1rem;
  color: #183660; background: linear-gradient(135deg,#fff8dc,#edf7ff);
  border: 1px solid #e8c45a; border-radius: 12px;
}
.week-summary span, .auto-assignment span { color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.week-summary small { color: var(--muted); }

.image-editor {
  display: grid; grid-template-columns: minmax(260px,.85fr) minmax(280px,1fr); gap: 1.25rem;
  padding: 1rem; background: #eaf3fb; border: 1px solid #c8d8e7; border-radius: 16px;
}
.image-editor h3 { margin: 0; }
.image-editor label { margin-top: .7rem; }
.editor-stage {
  position: relative; overflow: hidden; aspect-ratio: 1; cursor: crosshair;
  background: #102b67; border: 4px solid white; border-radius: 18px;
  box-shadow: 0 8px 24px rgba(7,26,67,.2);
}
.editor-stage img { width: 100%; height: 100%; object-fit: cover; transition: transform .12s ease; }
.piece-marker {
  position: absolute; width: 58px; height: 58px; transform: translate(-50%,-50%);
  border: 3px solid var(--gold); border-radius: 13px; box-shadow: 0 0 0 3px rgba(13,41,87,.78), 0 0 18px var(--gold);
  pointer-events: none;
}
.piece-marker::after { content: "+"; position: absolute; inset: 0; display: grid; place-items: center; color: white; font-size: 1.8rem; text-shadow: 0 2px 4px #000; }
.level-tabs { display: grid; grid-template-columns: repeat(5,1fr); gap: .55rem; margin: 0 0 1rem; }
.level-tabs a { padding: .65rem; text-align: center; text-decoration: none; font-weight: 850; color: #24466e; background: #fff; border: 1px solid #c7d5e3; border-radius: 12px; }
.level-tabs a.active { color: #fff; background: linear-gradient(#326eb2,#142f68); border-color: var(--gold); }

.chart-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.2rem; }
.bar-chart { display: flex; align-items: stretch; gap: .35rem; height: 240px; padding-top: 1rem; }
.bar-column { display: grid; grid-template-rows: 1fr auto; flex: 1; min-width: 24px; text-align: center; }
.bars { display: flex; align-items: end; justify-content: center; gap: 2px; min-height: 190px; border-bottom: 1px solid #bfcddd; }
.bars i, .bars b { width: 38%; min-height: 2px; border-radius: 5px 5px 0 0; }
.bars i { background: linear-gradient(#38bdf8,#174a88); }
.bars b { background: linear-gradient(#ffd86b,#db8f05); }
.bar-column small { padding-top: .25rem; color: var(--muted); font-size: .68rem; }
.legend { display: flex; gap: 1rem; color: var(--muted); font-size: .82rem; }
.legend span::before { content:""; display:inline-block; width:10px; height:10px; margin-right:.3rem; border-radius:3px; }
.legend .views::before { background:#2684c6; }.legend .clicks::before { background:#e6a20a; }
.horizontal-chart { display: grid; gap: .9rem; margin-top: 1.2rem; }
.horizontal-chart > div { display: grid; grid-template-columns: 64px 1fr 42px; align-items: center; gap: .55rem; }
.horizontal-chart i { height: 18px; overflow: hidden; background: #e3ebf3; border-radius: 99px; }
.horizontal-chart b { display: block; height: 100%; background: linear-gradient(90deg,#f6c74e,#d99a09); border-radius: inherit; }

@media (max-width: 850px) {
  .image-editor, .chart-grid { grid-template-columns: 1fr; }
  .prize-row { grid-template-columns: 1fr 150px 42px; }
}
@media (max-width: 560px) {
  .prize-row { grid-template-columns: 1fr 42px; }
  .prize-row .money-input { grid-column: 1; }
  .level-tabs { grid-template-columns: repeat(3,1fr); }
}
