* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--uc-bg);
  color: var(--uc-text);
  overflow: hidden;
}

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.app-topbar {
  flex: 0 0 auto;
  padding: 10px 24px;
  border-bottom: 1px solid var(--uc-border);
  background: var(--uc-surface);
}

.uc-topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--uc-font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--uc-muted);
  text-decoration: none;
}

.uc-topbar-link:hover {
  color: var(--uc-accent);
}

.uc-topbar-arrow {
  font-family: var(--uc-font-mono);
}

.app-body {
  flex: 1;
  display: flex;
  min-height: 0;
  position: relative;
}

.toggle-sidebar {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 1000;
  margin: 0;
  width: 44px;
  height: 38px;
  font-size: 20px;
}

.sidebar {
  width: 320px;
  padding: 70px 24px 24px;
  background: var(--uc-surface);
  border-right: 1px solid var(--uc-border);
  transition: all .25s ease;
  overflow: auto;
}

.sidebar.hidden {
  width: 0;
  padding-left: 0;
  padding-right: 0;
  border-right: 0;
  overflow: hidden;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  min-width: 0;
}

h2 {
  margin-top: 0;
}

textarea {
  width: 100%;
  height: 220px;
  resize: vertical;
  padding: 10px;
  font-size: 16px;
  border: 1px solid var(--uc-border);
  border-radius: var(--uc-radius);
}

button {
  padding: 10px 16px;
  cursor: pointer;
  border: 1px solid var(--uc-border);
  background: var(--uc-surface);
  border-radius: var(--uc-radius);
  font-size: 15px;
}

button:hover {
  background: var(--color-surface-hover, #eee);
}

button.primary {
  background: var(--uc-text);
  color: var(--color-on-primary, #fff);
  border-color: var(--uc-text);
}

button.primary:hover {
  background: var(--color-primary-hover, #333);
}

.sidebar button {
  width: 100%;
  margin-top: 12px;
}

.timer {
  position: absolute;
  top: 24px;
  text-align: center;
}

.timer-value {
  font-size: 54px;
  font-weight: bold;
  line-height: 1;
}

.timer-label {
  margin-top: 6px;
  color: var(--uc-muted);
  font-size: 17px;
}

.wheel-wrap {
  position: relative;
  width: 620px;
  height: 620px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 70px;
}

canvas {
  border-radius: 50%;
  transition: transform 4s cubic-bezier(.15,.85,.2,1);
  box-shadow: var(--shadow-md, 0 8px 28px rgba(0,0,0,.12));
  background: var(--uc-surface);
}

.pointer {
  position: absolute;
  left: -18px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 25px solid transparent;
  border-bottom: 25px solid transparent;
  border-left: 42px solid var(--uc-accent);
  z-index: 2;
}

.center {
  position: absolute;
  width: 165px;
  height: 165px;
  border-radius: 50%;
  background: var(--uc-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 23px;
  font-weight: bold;
  box-shadow: inset 0 0 8px rgba(0,0,0,.25);
  pointer-events: none;
}

.controls {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.winner {
  margin-top: 16px;
  min-width: 520px;
  padding: 14px 18px;
  border: 1px solid var(--uc-border);
  border-radius: var(--uc-radius);
  text-align: center;
  font-size: 22px;
  font-weight: bold;
  background: var(--color-surface-translucent, rgba(255,255,255,.7));
}

.muted-list {
  margin-top: 22px;
  font-size: 15px;
  color: var(--uc-muted);
}

.excluded-box {
  margin-top: 8px;
  min-height: 60px;
  padding: 12px;
  border: 1px solid var(--uc-border);
  border-radius: var(--uc-radius);
  background: var(--color-surface-alt, #fafafa);
  line-height: 1.5;
}

.hint {
  margin-top: 22px;
  padding: 14px;
  border: 1px solid var(--uc-border);
  border-radius: var(--uc-radius);
  background: var(--color-surface-alt, #fafafa);
  font-size: 14px;
  line-height: 1.45;
  color: var(--color-text-secondary, #444);
}

.context-menu {
  position: fixed;
  display: none;
  background: var(--uc-surface);
  border: 1px solid var(--uc-border);
  border-radius: var(--uc-radius);
  box-shadow: var(--shadow-lg, 0 6px 18px rgba(0,0,0,.18));
  z-index: 10;
  overflow: hidden;
}

.context-menu button {
  margin: 0;
  width: 240px;
  border: 0;
  border-radius: 0;
  text-align: left;
}

@media (max-width: 900px) {
  .wheel-wrap {
    width: 90vw;
    height: 90vw;
  }

  canvas {
    width: 90vw;
    height: 90vw;
  }

  .winner {
    min-width: auto;
    width: 80vw;
  }

  .timer-value {
    font-size: 42px;
  }
}
