/* =================================================================
   SpinnyPick v1.6.0 CSS - Robust Stacked Layout & Polished UX
================================================================= */

:root {
    --brand-color: #15b46f;
    --danger-color: #d33;
    --dark-color: #333;
    --border-color: #e0e0e0;
}

/* ——— Main Layout & Structure ——— */
.spk-wrap {
    max-width: 900px; /* Center the whole component on the page */
    margin: 0 auto;
    padding: 20px 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* FIX: A much simpler and more robust layout. This stacks the two main components
   vertically and lets them grow to a large, fixed max-width. This is far less
   likely to be broken by a theme's container. */
.spk-flex {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center the components horizontally */
    gap: 40px;
}
.spk-wheel-container,
.spk-side {
    width: 100%;
    max-width: 700px; /* Make both components large */
}
.spk-wheel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.spk-side {
    display: flex;
    flex-direction: column;
}

/* ——— The Wheel & Spin Button ——— */
.spk-canvas { position: relative; width: 100%; }
#spkCanvas {
    display: block; width: 100%; height: auto;
    border-radius: 50%; box-shadow: 0 5px 25px rgba(0, 0, 0, .2);
}
.spk-pointer {
    position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
    width: 0; height: 0; border-left: 20px solid transparent;
    border-right: 20px solid transparent; border-top: 35px solid var(--danger-color);
    z-index: 10; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4));
}
.spk-spin {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    /* FIX: Complete UX Overhaul for maximum readability and a clean, pressable feel. */
    background: var(--brand-color);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    /* Using a subtle border and shadows for the 3D effect instead of a thick outline */
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 25%; height: 25%; max-width: 150px; max-height: 150px;
    font-weight: 700;
    font-size: clamp(18px, 5vw, 32px);
    cursor: pointer; z-index: 10;
    box-shadow: 
        inset 0 3px 5px rgba(0,0,0,0.2),  /* Inner top shadow */
        inset 0 -3px 5px rgba(255,255,255,0.2), /* Inner bottom highlight */
        0 5px 15px rgba(0,0,0,0.3);       /* Drop shadow */
    transition: all .15s ease-out;
}
.spk-spin:hover { transform: translate(-50%, -50%) scale(1.05); }
.spk-spin:active {
    transform: translate(-50%, -50%) scale(0.98);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.4);
}
.spk-spin:disabled { cursor: not-allowed; opacity: 0.7; }

/* ——— Side Panel (Inputs, List, Actions) ——— */
.spk-form { display: flex; gap: 10px; margin-bottom: 15px; }
.spk-form input[type="text"] { flex: 1; padding: 12px; border: 1px solid #ccc; border-radius: 5px; font-size: 16px; }
.spk-side-actions { display: flex; gap: 10px; margin-bottom: 15px; }
.spk-list-wrap {
    flex-grow: 1; min-height: 350px; max-height: 500px;
    overflow-y: auto; border: 1px solid var(--border-color);
    padding: 12px; border-radius: 5px; background: #fafafa;
}
.spk-list { list-style: none; padding: 0; margin: 0; }
.spk-list li {
    display: flex; align-items: center; gap: 12px; margin-bottom: 8px;
    background: #fff; padding: 12px; border-radius: 4px; font-size: 16px;
    border: 1px solid var(--border-color);
}
.spk-list .box { width: 22px; height: 22px; border-radius: 3px; flex-shrink: 0; }
.spk-list li span:nth-of-type(2) { flex-grow: 1; word-break: break-all; }
.spk-list li button {
    margin-left: auto; background: var(--danger-color); border: none; color: #fff;
    width: 28px; height: 28px; line-height: 28px; text-align: center;
    border-radius: 4px; cursor: pointer; flex-shrink: 0; transition: background .2s;
}
.spk-list li button:hover { background: #b72b2b; }

/* ——— General Buttons ——— */
.spk-btn {
    padding: 12px 18px; font-size: 15px; border-radius: 5px;
    background: var(--brand-color); border: none; color: #fff;
    cursor: pointer; transition: opacity .2s; display: inline-flex;
    align-items: center; justify-content: center; gap: 8px; font-weight: 500;
}
.spk-btn:hover { opacity: .85; }
.spk-btn:disabled { opacity: .6; cursor: not-allowed; }
.spk-clear { background: #666; }

/* Minified styles for controls and modals remain the same */
.spk-controls-bar{display:flex;justify-content:space-between;align-items:center;width:100%;padding:0 15px;box-sizing:border-box}.spk-control-btn{background:none;border:none;font-size:24px;color:#555;cursor:pointer;padding:5px;transition:color .2s}.spk-control-btn:hover{color:var(--brand-color)}.spk-sound-control{position:relative;display:flex;align-items:center}.spk-volume-slider{width:80px;margin-left:10px;visibility:hidden;opacity:0;transform:scaleX(0);transform-origin:left;transition:all .2s ease}.spk-sound-control:hover .spk-volume-slider{visibility:visible;opacity:1;transform:scaleX(1)}.spk-modal{position:fixed;inset:0;z-index:9999;display:none;align-items:center;justify-content:center}.spk-modal.is-visible{display:flex}.spk-modal-overlay{position:absolute;inset:0;background:rgba(0,0,0,.6);animation:fadeIn .3s ease}.spk-modal-box{background:#fff;padding:25px;border-radius:8px;max-width:420px;width:90%;position:relative;z-index:1;box-shadow:0 5px 20px rgba(0,0,0,.3);animation:zoomIn .3s ease-out}.spk-close{position:absolute;top:8px;right:10px;font-size:28px;font-weight:bold;color:#888;border:none;background:none;cursor:pointer;line-height:1}.spk-close:hover{color:#000}.spk-winner-box{text-align:center;padding:40px 20px 30px}.spk-winner-box h2{font-size:clamp(24px,8vw,38px);margin:0 0 10px;word-wrap:break-word;color:var(--dark-color)}.spk-winner-box p{font-size:16px;color:#777;margin:0 0 30px}.spk-modal-actions{display:flex;gap:10px;justify-content:center}.spk-results-list{max-height:280px;overflow-y:auto;margin-bottom:15px;border-top:1px solid var(--border-color);border-bottom:1px solid var(--border-color)}.spk-results-list-item{display:flex;justify-content:space-between;align-items:center;padding:10px 5px;font-size:15px;border-bottom:1px solid #f0f0f0}.spk-results-list-item:last-child{border-bottom:none}.spk-results-count{background:var(--brand-color);color:#fff;font-size:12px;font-weight:bold;padding:3px 8px;border-radius:10px;margin-left:10px}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes zoomIn{from{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}