:root{
  --bg: #0b1630;

  --glass: rgba(10, 18, 35, .46);
  --glass-2: rgba(10, 18, 35, .34);

  --border: rgba(255,255,255,.14);
  --border-2: rgba(255,255,255,.20);

  --text: #ffffff;
  --muted: rgba(255,255,255,.78);

  --accent: #ffe06a;
  --primary: #5dd6ff;  /* modern cyan */
  --danger: #ff3b3b;

  --shadow: 0 18px 42px rgba(0,0,0,.28);
  --radius: 16px;
}

*{ box-sizing: border-box; }

html, body{
  height: 100%;
  margin: 0;
  background: var(--bg);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
}

#app{
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#c{
  display: block;
  width: 100%;
  height: 100%;
}

/* UI overlay above canvas */
.ui{
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  user-select: none;
}

/* interactive */
.ui button,
.ui input,
.ui label{
  pointer-events: auto;
}
.ui input{ user-select: text; }

/* -------------------------
   Brand / Logo
------------------------- */
.brand{
  position: absolute;
  top: 18px;
  left: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.brand-mark{
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 1000;
  letter-spacing: 1px;
  color: #081225;
  background: linear-gradient(135deg, var(--accent), #ffffff);
}

.brand-text{ line-height: 1.05; }
.brand-name{
  color: var(--text);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: .3px;
}
.brand-sub{
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
  margin-top: 2px;
}

/* -------------------------
   Top center
------------------------- */
.top{
  position: absolute;
  top: 22px;
  left: 0;
  right: 0;
  display: grid;
  place-items: center;
  gap: 10px;
}

.title{
  font-weight: 1000;
  letter-spacing: 2px;
  font-size: clamp(28px, 6vw, 72px);
  color: var(--accent);
  text-shadow: 0 10px 24px rgba(0,0,0,.38);
}

.timer{
  background: rgba(0,0,0,.34);
  border: 1px solid rgba(255,255,255,.18);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 950;
  font-size: 28px;
  color: var(--text);
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 32px rgba(0,0,0,.18);
}

/* -------------------------
   Left panel
------------------------- */
.left-panel{
  position: absolute;
  top: 130px;
  left: 18px;
  width: 300px;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.panel-title{
  color: var(--text);
  font-weight: 950;
  margin-bottom: 10px;
  letter-spacing: .2px;
}

.rows{
  display: grid;
  gap: 8px;
}

.row{
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  padding: 10px 10px;
  color: var(--text);
  font-weight: 850;
}

.badge{
  font-weight: 1000;
  text-align: center;
  border-radius: 12px;
  padding: 7px 0;
  background: rgba(255,255,255,.10);
}

/* -------------------------
   Finish badge (right)
------------------------- */
.finish-badge{
  position: absolute;
  top: 190px;
  right: 26px;
  background: var(--danger);
  color: var(--text);
  font-weight: 1000;
  padding: 12px 18px;
  border-radius: 14px;
  transform: rotate(-4deg);
  box-shadow: 0 16px 36px rgba(0,0,0,.28);
}

/* -------------------------
   Bottom bar
------------------------- */
.bottom-bar{
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.btn{
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.18);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 950;
  cursor: pointer;
  transition: transform .08s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.btn:hover{
  background: rgba(0,0,0,.28);
  border-color: rgba(255,255,255,.26);
}

.btn:active{ transform: translateY(1px); }

.btn-primary{
  background: rgba(93,214,255,.20);
  border-color: rgba(93,214,255,.42);
  box-shadow: 0 10px 20px rgba(93,214,255,.10);
}

.btn-primary:hover{
  background: rgba(93,214,255,.28);
  border-color: rgba(93,214,255,.55);
}

.divider{
  width: 1px;
  height: 30px;
  background: rgba(255,255,255,.18);
  margin: 0 2px;
}

/* duration */
.duration{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: .2px;
}

.duration-label{ opacity: .9; }
.duration-unit{ opacity: .85; font-weight: 900; }

#durationInput{
  width: 86px;
  height: 36px;
  padding: 6px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(0,0,0,.18);
  color: var(--text);
  outline: none;
}

#durationInput:focus{
  border-color: rgba(93,214,255,.70);
  box-shadow: 0 0 0 4px rgba(93,214,255,.16);
}

/* reduce chrome number spinners (optional) */
#durationInput::-webkit-outer-spin-button,
#durationInput::-webkit-inner-spin-button{
  opacity: .9;
}

/* -------------------------
   Winner overlay
------------------------- */
.winner{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: var(--text);
  font-weight: 1000;
  font-size: clamp(28px, 5vw, 58px);
  text-shadow: 0 12px 26px rgba(0,0,0,.45);
}

/* -------------------------
   Duck label
------------------------- */
.duck-label{
  color: var(--text);
  font-weight: 1000;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.42);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
  white-space: nowrap;
  text-shadow: 0 6px 14px rgba(0,0,0,.55);
  transform: translateY(-8px);
}

/* -------------------------
   Responsive
------------------------- */
@media (max-width: 720px){
  .left-panel{
    width: 260px;
    top: 120px;
  }
}

@media (max-width: 520px){
  .brand{
    left: 12px;
    top: 12px;
    padding: 9px 10px;
  }
  .left-panel{
    left: 12px;
    width: 240px;
  }
  .bottom-bar{
    gap: 8px;
    padding: 10px;
    border-radius: 16px;
  }
  #durationInput{ width: 74px; }
  .timer{ font-size: 24px; }
}

.players-editor{
	margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.14);
}

.players-head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.players-title{
  color: var(--text);
  font-weight: 950;
  font-size: 13px;
  letter-spacing: .2px;
  opacity: .95;
}

.players-meta{
  color: rgba(255,255,255,.72);
  font-weight: 850;
  font-size: 12px;
}

#playersInput{
  width: 100%;
  resize: vertical;
  min-height: 110px;
  max-height: 240px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.18);
  color: var(--text);
  outline: none;
  font-weight: 800;
  line-height: 1.35;
}

#playersInput::placeholder{
  color: rgba(255,255,255,.45);
  font-weight: 750;
}

#playersInput:focus{
  border-color: rgba(93,214,255,.70);
  box-shadow: 0 0 0 4px rgba(93,214,255,.16);
  background: rgba(0,0,0,.22);
}

.players-actions{
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.players-hint{
  font-size: 12px;
  color: rgba(255,255,255,.72);
  font-weight: 800;
}

.players-hint.error{
  color: #ffb3b3;
}

.results{
  position: absolute;
  right: 18px;
  bottom: 90px;
  width: 320px;
  background: rgba(10, 18, 35, 0.78);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 12px;
  backdrop-filter: blur(10px);
}

.results-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

.results-title{
  font-weight: 700;
}

#resultsText{
  width:100%;
  box-sizing:border-box;
  border-radius:10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
  color: #fff;
  padding: 10px;
  resize: vertical;
}

/* Ensure canvas is the background */
#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#c {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

/* UI must be above canvas and clickable */
.ui {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: auto;
}

/* Make sure the editor is clickable (in case you set pointer-events somewhere else) */
.players-editor,
#playersInput,
.duration,
#durationInput,
.bottom-bar,
.left-panel {
  pointer-events: auto;
}

/* Optional but often needed if you had global user-select: none somewhere */
#playersInput,
#durationInput,
textarea,
input {
  user-select: text;
  -webkit-user-select: text;
}

.brand {
	display: flex;
	align-items: center;
	gap: 12px;
}

.brand-logo {
	width: 44px;
	height: 44px;
	object-fit: contain;
	border-radius: 8px; /* αν δεν το θες, αφαίρεσέ το */
}